Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Sv translation
languageen

/api/reports/:id/images

Posts an image to the report with the specified ID.

Resource Information

Request Parameters

Parameters

Detail

Example

id

ID of the report for which to post an image. You can find the ID in the response to /api/reports.

123

name

(Optional) New image view name.

My View Name
fileImage file. 
width(Optional) Query parameter specifying view width (percentage value).30
height(Optional) Query parameter specifying view height (absolute value in pixels).500

Sample Request / Response

Using curl (you have to use "@" character before full path to image file):

Code Block
curl POST -H "Content-Type: multipart/form-data" -H "Authorization: OAuth realm=\"https://service.belladati.com/\", oauth_consumer_key=\"myConsumer\", oauth_token=\"mh7an9dkrg59\", oauth_timestamp=\"135131231\", oauth_nonce=\"randomString\"" -F "name=My View Name" -F "file=@/path/to/file.png" "https://service.belladati.com/api/reports/123/images?width=30&height=500"

When the image has been posted successfully, the response has the HTTP status code 200 and the content contains image view ID.

Code Block
{
    "viewId":"34-uRSxwaBSD"
}
Sv translation
languageja

/api/reports/:id/images

指定されたIDを使用してレポートに画像を投稿します。

リソース情報

リクエストパラメータ

パラメーター

詳細

id

画像を投稿するためのレポートのID。/api/reportsに応じて、IDを見つけることができます。

123

name

新しい画像ビュー名

My View Name
file画像ファイル
width(任意)クエリパラメータビューの幅を指定します(パーセント値)。30
height(任意)ビューの高さを指定するクエリパラメータ(ピクセル単位の絶対値)。500

サンプルリクエスト/レスポンス

curl 使用(画像ファイルのフルパスの前に"@"文字を使用する必要がある)

Code Block
curl POST -H "Content-Type: multipart/form-data" -H "Authorization: OAuth realm=\"https://service.belladati.com/\", oauth_consumer_key=\"myConsumer\", oauth_token=\"mh7an9dkrg59\", oauth_timestamp=\"135131231\", oauth_nonce=\"randomString\"" -F "name=My View Name" -F "file=@/path/to/file.png" "https://service.belladati.com/api/reports/123/images?width=30&height=500"

画像が正常に投稿された場合、レスポンスはHTTP 200ステータスコードとコンテンツがビューID画像が含まれます。

Code Block
{
    "viewId":"34-uRSxwaBSD"
}