问题
So I've submitted a request using travis api v3 guide and got response like:
{
"@type": "pending",
"remaining_requests": 10,
"repository": {
"@type": "repository",
"@href": "/repo/111111111",
"@representation": "minimal",
"id": 111111111,
"name": "my-111111111",
"slug": "me/my111111111"
},
"request": {
"repository": {
"id": 222222,
"owner_name": "me",
"name": "my-111111111"
},
"user": {
"id": 333333
},
"id": 444444,
"message": "Cool message",
"branch": "master"
},
"resource_type": "request"
}
So what is the way to get status of those jobs now? I suppose that I need to use id 444444, but I am getting error below, not sure what I am doing wrong:
curl -s -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Travis-API-Version: 3" \
-H "Authorization: token mycooltoken" \
https://api.travis-ci.org/repo/111111111/requests/444444
{
"@type": "error",
"error_type": "not_found",
"error_message": "resource not found (or insufficient access)"
}
Can somebody point me where to look for examples or any other idea?
回答1:
Oh sorry for confusion - somehow I overlooked that I must change POST to GET; with that simple fix everything worked fine.
来源:https://stackoverflow.com/questions/44569955/check-status-of-job-requested-through-travis-api-v3