WorkItem в AutoCAD I/O API - часть 2
Чтобы получить WorkItem
GET autocad.io/us-east/v2/WorkItems('{my_id}')
Получитаем конкретный WorkItem
Пример успешного запроса:
- GET /autocad.io/us-east/v2/WorkItems('9688d314d6e94bc682f901b468ca8dbc') HTTP/1.1
- Accept: application/json
- Accept-Charset: UTF-8
- Authorization: Bearer my_token
- Host: autocad.io
Пример успешного ответа:
- HTTP/1.1 200 OK
- Cache-Control: no-cache
- Content-Type: application/json; charset=utf-8
- Date: Tue, 13 May 2014 00:29:38 GMT
- Expires: -1
- Pragma: no-cache
- Server: Microsoft-IIS/8.0
- X-AspNet-Version: 4.0.30319
- X-Powered-By: ASP.NET
- Content-Length: 2735
- Connection: keep-alive
- {
- "@odata.context":"https://developer-dev.api.autodesk.com/autocad.io/us-east/v2/$metadata#WorkItems/$entity","ActivityId":"PlotToPDF","Arguments":{
- "InputArguments":[
- {
- "Resource":"https://s3.amazonaws.com/AutoCAD-Core-Engine-Services/TestDwg/makeall.dwg","Name":"HostDwg","Headers":[
- ],"ResourceKind":null,"StorageProvider":"Generic","HttpVerb":null
- }
- ],"OutputArguments":[
- {
- "Resource":"https://acesdev.s3-us-west-2.amazonaws.com/aces-workitem-outputs/9688d314d6e94bc682f901b468ca8dbc/result.pdf?AWSAccessKeyId=
- ASIAIIRAOVQYGB4OA7IA&Expires=1432231792&x-amz-security-token=AQoDYXdzEGIa0AMSDjA8SIKRwWVY8YvdmMQsZ3T5atGN2gDTUwcffe%2FMejuRGezSx%2F4lDaN1Nw
- sGCc%2B91eXvocmWaEZA%2Bm8uClMwP%2Fr69UmL6RmOiK7dokQlbQGEoPEQwF%2Frpw2jPQ6wDq4suFWXlsuxODWP24v3GJ4fZRj9V4S91Z59Nagcla6Ll46YVS6rc0PlaC4ElJ89n
- cABb23dR%2BK%2FAAaPsFVVn8ZV81gqDbect8YjvMH2RCfXQb7KnheNFlL77AXMeJM11ahq3UUsDk2o3uYQswJQJg5AsYZEtXjbbKU40MDkLPKjn5Ua18%2FD1pNZFm%2FFhoHMHXHv
- fvJdfXPWHBKYEFCvIz%2FZyKg8CORDIpK04ZMuAV68jTiHGkes7U5L5QPnCDEDAyZnod6FK7djcNYQwJBE9SNge%2FBLAXmJ5Hsiuy8HZF7GF59LPSR%2BXyygw%2Fy1ssJxmKxK4js
- UG33ukj69Mj1nXlKfVdk89cdonuOScw%2BnD91%2B1kRozlIXkDT9Crf%2FceshJHY48vaPtJ5VG1sGIZoHW5fzwcbXDEJzhLJcj0UaFr5N3sgMKCX7KtZcqRYp%2Bupd7khRSAhC2L
- ZdOyCHAQgi45F11qYZ8fwiUassVPEYIwTpYiDbgfOqBQ%3D%3D&Signature=02E4g51C2R9NsdwX0vloUmX8RCM%3D","Name":"Result","Headers":[
- ],"ResourceKind":null,"StorageProvider":"Generic","HttpVerb":"POST"
- }
- ]
- },"Status":"Succeeded","StatusDetails":{
- "Report":"https://acesdev.s3-us-west-2.amazonaws.com/aces-workitem-reports/9688d314d6e94bc682f901b468ca8dbc/report.log?AWSAccessKeyId=ASIAIIRAOVQ
- YGB4OA7IA&Expires=1432231871&x-amz-security-token=AQoDYXdzEGIa0AMSDjA8SIKRwWVY8YvdmMQsZ3T5atGN2gDTUwcffe%2FMejuRGezSx%2F4lDaN1NwsGCc%2B91eXvocmWa
- EZA%2Bm8uClMwP%2Fr69UmL6RmOiK7dokQlbQGEoPEQwF%2Frpw2jPQ6wDq4suFWXlsuxODWP24v3GJ4fZRj9V4S91Z59Nagcla6Ll46YVS6rc0PlaC4ElJ89ncABb23dR%2BK%2FAAaPsFVV
- n8ZV81gqDbect8YjvMH2RCfXQb7KnheNFlL77AXMeJM11ahq3UUsDk2o3uYQswJQJg5AsYZEtXjbbKU40MDkLPKjn5Ua18%2FD1pNZFm%2FFhoHMHXHvfvJdfXPWHBKYEFCvIz%2FZyKg8COR
- DIpK04ZMuAV68jTiHGkes7U5L5QPnCDEDAyZnod6FK7djcNYQwJBE9SNge%2FBLAXmJ5Hsiuy8HZF7GF59LPSR%2BXyygw%2Fy1ssJxmKxK4jsUG33ukj69Mj1nXlKfVdk89cdonuOScw%2Bn
- D91%2B1kRozlIXkDT9Crf%2FceshJHY48vaPtJ5VG1sGIZoHW5fzwcbXDEJzhLJcj0UaFr5N3sgMKCX7KtZcqRYp%2Bupd7khRSAhC2LZdOyCHAQgi45F11qYZ8fwiUassVPEYIwTpYiDbgfO
- qBQ%3D%3D&Signature=omaAOII4CQaMUAXGChgsvT37I%2FU%3D"
- },"AvailabilityZone":null,"TimeQueued":"2015-05-20T18:09:47.957Z","TimeInputTransferStarted":"2015-05-20T18:09:48.035Z","TimeScriptStarted":"2015-05-20T18:09:48.707Z",
- "TimeScriptEnded":"2015-05-20T18:09:52.035Z","TimeOutputTransferEnded":"2015-05-20T18:09:52.16Z","BytesTranferredIn":169056,
- "BytesTranferredOut":53800,"Id":"9688d314d6e94bc682f901b468ca8dbc","Version":1,"Timestamp":"2015-05-20T18:09:52.16Z"
- }
Заголовки запроса
Заголовок запроса |
Описание |
|
Authorization |
- Bearer my_token |
|
Чтобы получить все WorkItems
POST autocad.io/us-east/v2/WorkItems
Получить все WorkItems
Пример успешного запроса:
- GET /autocad.io/us-east/v2/WorkItems HTTP/1.1
- Accept: application/json
- Accept-Charset: UTF-8
- Authorization: Bearer my_token
- Host: autocad.io
Пример успешного ответа:
- HTTP/1.1 200 OK
- Cache-Control: no-cache
- Content-Type: application/json; charset=utf-8
- Date: Mon, 12 May 2014 23:50:10 GMT
- Expires: -1
- Pragma: no-cache
- Server: Microsoft-IIS/8.0
- X-AspNet-Version: 4.0.30319
- X-Powered-By: ASP.NET
- Content-Length: 216490
- Connection: keep-alive
- {
- "odata.metadata":"https://developer.api.autodesk.com/autocad.io/us-east/v2/$metadata#WorkItems","value":[
- {
- "@odata.context":"https://developer-dev.api.autodesk.com/autocad.io/us-east/v2/$metadata#WorkItems/$entity","ActivityId":"PlotToPDF","Arguments":{
- "InputArguments":[
- {
- "Resource":"https://s3.amazonaws.com/AutoCAD-Core-Engine-Services/TestDwg/makeall.dwg","Name":"HostDwg","Headers":[
- ],"ResourceKind":null,"StorageProvider":"Generic","HttpVerb":null
- }
- ],"OutputArguments":[
- {
- "Resource":"https://acesdev.s3-us-west-2.amazonaws.com/aces-workitem-outputs/9688d314d6e94bc682f901b468ca8dbc/result.pdf?AWSAccessKeyId=
- ASIAIIRAOVQYGB4OA7IA&Expires=1432231792&x-amz-security-token=AQoDYXdzEGIa0AMSDjA8SIKRwWVY8YvdmMQsZ3T5atGN2gDTUwcffe%2FMejuRGezSx%2F4lDaN1Nw
- sGCc%2B91eXvocmWaEZA%2Bm8uClMwP%2Fr69UmL6RmOiK7dokQlbQGEoPEQwF%2Frpw2jPQ6wDq4suFWXlsuxODWP24v3GJ4fZRj9V4S91Z59Nagcla6Ll46YVS6rc0PlaC4ElJ89n
- cABb23dR%2BK%2FAAaPsFVVn8ZV81gqDbect8YjvMH2RCfXQb7KnheNFlL77AXMeJM11ahq3UUsDk2o3uYQswJQJg5AsYZEtXjbbKU40MDkLPKjn5Ua18%2FD1pNZFm%2FFhoHMHXHv
- fvJdfXPWHBKYEFCvIz%2FZyKg8CORDIpK04ZMuAV68jTiHGkes7U5L5QPnCDEDAyZnod6FK7djcNYQwJBE9SNge%2FBLAXmJ5Hsiuy8HZF7GF59LPSR%2BXyygw%2Fy1ssJxmKxK4js
- UG33ukj69Mj1nXlKfVdk89cdonuOScw%2BnD91%2B1kRozlIXkDT9Crf%2FceshJHY48vaPtJ5VG1sGIZoHW5fzwcbXDEJzhLJcj0UaFr5N3sgMKCX7KtZcqRYp%2Bupd7khRSAhC2L
- ZdOyCHAQgi45F11qYZ8fwiUassVPEYIwTpYiDbgfOqBQ%3D%3D&Signature=02E4g51C2R9NsdwX0vloUmX8RCM%3D","Name":"Result","Headers":[
- ],"ResourceKind":null,"StorageProvider":"Generic","HttpVerb":"POST"
- }
- ]
- },"Status":"Succeeded","StatusDetails":{
- "Report":"https://acesdev.s3-us-west-2.amazonaws.com/aces-workitem-reports/9688d314d6e94bc682f901b468ca8dbc/report.log?AWSAccessKeyId=ASIAIIRAOVQ
- YGB4OA7IA&Expires=1432231871&x-amz-security-token=AQoDYXdzEGIa0AMSDjA8SIKRwWVY8YvdmMQsZ3T5atGN2gDTUwcffe%2FMejuRGezSx%2F4lDaN1NwsGCc%2B91eXvocmWa
- EZA%2Bm8uClMwP%2Fr69UmL6RmOiK7dokQlbQGEoPEQwF%2Frpw2jPQ6wDq4suFWXlsuxODWP24v3GJ4fZRj9V4S91Z59Nagcla6Ll46YVS6rc0PlaC4ElJ89ncABb23dR%2BK%2FAAaPsFVV
- n8ZV81gqDbect8YjvMH2RCfXQb7KnheNFlL77AXMeJM11ahq3UUsDk2o3uYQswJQJg5AsYZEtXjbbKU40MDkLPKjn5Ua18%2FD1pNZFm%2FFhoHMHXHvfvJdfXPWHBKYEFCvIz%2FZyKg8COR
- DIpK04ZMuAV68jTiHGkes7U5L5QPnCDEDAyZnod6FK7djcNYQwJBE9SNge%2FBLAXmJ5Hsiuy8HZF7GF59LPSR%2BXyygw%2Fy1ssJxmKxK4jsUG33ukj69Mj1nXlKfVdk89cdonuOScw%2Bn
- D91%2B1kRozlIXkDT9Crf%2FceshJHY48vaPtJ5VG1sGIZoHW5fzwcbXDEJzhLJcj0UaFr5N3sgMKCX7KtZcqRYp%2Bupd7khRSAhC2LZdOyCHAQgi45F11qYZ8fwiUassVPEYIwTpYiDbgfO
- qBQ%3D%3D&Signature=omaAOII4CQaMUAXGChgsvT37I%2FU%3D"
- },"AvailabilityZone":null,"TimeQueued":"2015-05-20T18:09:47.957Z","TimeInputTransferStarted":"2015-05-20T18:09:48.035Z","TimeScriptStarted":"2015-05-20T18:09:48.707Z",
- "TimeScriptEnded":"2015-05-20T18:09:52.035Z","TimeOutputTransferEnded":"2015-05-20T18:09:52.16Z","BytesTranferredIn":169056,
- "BytesTranferredOut":53800,"Id":"9688d314d6e94bc682f901b468ca8dbc","Version":1,"Timestamp":"2015-05-20T18:09:52.16Z"
- }
- ],"odata.nextLink":"https://developer.api.autodesk.com/autocad.io/us-east/v2/WorkItems?$skip=100"
- }
Заголовки запроса
Заголовок запроса |
Описание |
|
Authorization |
- Bearer my_token |
|
Чтобы обновить WorkItem
Обновление WorkItem не допускается. После того, как он будет создан, вы не можете его изменить.
Для удаления WorkItem
DELETE autocad.io/us-east/v2/WorkItems('{my_id}')
Удалить конкретный WorkItem если они находятся в очереди, но не выполняется. Таким образом, вы должны удалить его сразу после его создания. Если он был выполнен, он не может быть удален.
Пример успешного запроса:
- DELETE /autocad.io/us-east/v2/WorkItems('9688d314d6e94bc682f901b468ca8dbc') HTTP/1.1
- Authorization: Bearer my_token
Пример успешного ответа:
- HTTP/1.1 204 No Content
- Cache-Control: no-cache
- Date: Mon, 12 May 2014 19:03:40 GMT
- Expires: -1
- Pragma: no-cache
- Server: Microsoft-IIS/8.0
- X-AspNet-Version: 4.0.30319
- X-Powered-By: ASP.NET
- Connection: keep-alive
Заголовки запроса
Заголовок запроса |
Описание |
Authorization |
- Bearer my_token |
Примечание: При Patch завершился успешно, он возвращает "204 No Content". В противном случае, вы получите другой статус ошибки.
Источник: https://developer.autodesk.com/api/autocadio/#workitem-api
Обсуждение: http://adn-cis.org/forum/index.php?topic=
Опубликовано 03.04.2016