Skip to content

Commit d5bb767

Browse files
committed
サンプル追加
1 parent f8656e9 commit d5bb767

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,25 @@ composer run-script test
173173
## test some test case
174174
php vendor/bin/phpunit --filter get_space
175175
```
176+
177+
## サンプル
178+
179+
更新をするときのサンプル
180+
### 画像の投稿のサンプル
181+
画像を投稿して、画像を貼り付けたコメントを作る。
182+
```php
183+
$api = new BacklogAPIClient($space, $key);
184+
$part = [
185+
'name'=>"file",
186+
'contents' => file_get_contents(__DIR__.'/../../../../sample.jpg'),
187+
"filename"=>"sample.jpg"
188+
];
189+
$param = ['multipart' => [$part]];
190+
$ret = $api->postAttachmentFile($param);
191+
$params = [
192+
'content'=>"画像を貼り付ける\nサブスクに気をつけて\n![image][sample.jpg]\n",
193+
'attachmentId[]'=>$ret->id,
194+
];
195+
$ret = $api->addComment($key,$params);
196+
```
197+

0 commit comments

Comments
 (0)