m |
|||
| Line 66: | Line 66: | ||
An example using [http://curl.haxx.se/Curl Curl] for testing the API: | An example using [http://curl.haxx.se/Curl Curl] for testing the API: | ||
| - | <code>curl -F "core=@filename.core" -F "rich-core=@filename.rcore" -F "stack-trace=@trace.txt" -F "id=1234567890ABCDEF" -F "auth-token=123456" -F "attachment.1=@test.jpg" -F "release="1.2" -F "product=N900" -F "build=2011.20" http://crash-reports.leonidasoy.fi/api/import</code> | + | <code>curl -F "core=@filename.core" -F "rich-core=@filename.rcore" -F "stack-trace=@trace.txt" -F "id=1234567890ABCDEF" -F "auth-token=123456" -F "attachment.1=@test.jpg" -F "release="1.2" -F "product=N900" -F "build=2011.20" http://crash-reports.qa.leonidasoy.fi/api/import</code> |
The operation results status code in [http://en.wikipedia.org/wiki/JSON JSON] format. If the operation proceeds successfully, key value pair "ok" = 1 is returned with a link to the created report. | The operation results status code in [http://en.wikipedia.org/wiki/JSON JSON] format. If the operation proceeds successfully, key value pair "ok" = 1 is returned with a link to the created report. | ||
| - | <code>{"ok":"1", "url":"http://crash-reports.leonidasoy.fi/1234657890ABCDEF"}</code> | + | <code>{"ok":"1", "url":"http://crash-reports.qa.leonidasoy.fi/1234657890ABCDEF"}</code> |
In case of error, ''ok'' values is 0, and an additional field ''errors'' describing the problem is returned | In case of error, ''ok'' values is 0, and an additional field ''errors'' describing the problem is returned | ||
<code>{"ok":"0","errors":"unknown attribute: foobar"}</code> | <code>{"ok":"0","errors":"unknown attribute: foobar"}</code> | ||
Description: Import crash report
Method: POST [encoding multipart/form-data]
Parameters:
| Parameter name | Description | Values |
|---|---|---|
| auth-token | Personal authentication token | 123456789ABCDE |
| release | Release version | 1.0, 1.1, 1.2 |
| profile | MeeGo profile | Optional. Core, Handset, Tablet, Netbook, IVI |
| product | Product name | Ia-Russellville, N900, Pinetrail etc |
| build | Build name | e.g. 2011.14, 2011.15 etc |
| id | Unique identifier for the crash, e.g. MD5(core file) | |
| mac | MD5(device's MAC address) | Optional |
| imei | MD5(device's IMEI address) | Optional |
| core | Coredump as an attachment | |
| rich-core | Rich core as an attachment | |
| stack-trace | Stack trace as an attachment | |
| attachment.[1..n] | Other files to be attached with the report: Screenshots, logs etc | Optional |
The input can contain multiple attachment files. An unique field name have to be given for each file. Unique file names are created by giving a sequence number for each file starting from number 1, for example "attachment.1", "attachment.2" etc.
Because multiple files can be uploaded, HTTP POST with "multipart/form-encoding" is used.
An example using Curl for testing the API:
curl -F "core=@filename.core" -F "rich-core=@filename.rcore" -F "stack-trace=@trace.txt" -F "id=1234567890ABCDEF" -F "auth-token=123456" -F "attachment.1=@test.jpg" -F "release="1.2" -F "product=N900" -F "build=2011.20" http://crash-reports.qa.leonidasoy.fi/api/import
The operation results status code in JSON format. If the operation proceeds successfully, key value pair "ok" = 1 is returned with a link to the created report.
{"ok":"1", "url":"http://crash-reports.qa.leonidasoy.fi/1234657890ABCDEF"}
In case of error, ok values is 0, and an additional field errors describing the problem is returned
{"ok":"0","errors":"unknown attribute: foobar"}