Loading...
 

Download image


HTTP VerbPOST
URI Template/image/{imageID}/download
MIME Typeapplication/vnd.pncp.v.1.0+json onwards
Normal HTTP Response Code200 OK
Invoked byResellers can invoke this for their own account as well as any other account they own. End-clients can also place this request for their own account.
Response ModeAsynchronous (if the image needs to be packaged before it can be downloaded) or synchronous (if the image is already packaged for download).

Sample Request

POST /pncp-external-api-rest/image/428/download HTTP/1.1
Accept: application/vnd.pncp.v.5.0+json
Authorization: PNCP waTJRRFBGblBKTHhhN01qclZGai9QMllyajlJSW5weTJaOUlzPQ==
Content-Length: 0
User-Agent: Jakarta Commons-HttpClient/3.1
Host: YOUR_API_URL

Sample Response 1 (if download needs to be packaged first)

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Pragma: no-cache
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Cache-Control: no-cache
Cache-Control: no-store
Content-Type: application/vnd.pncp.v.5.0+json
Transfer-Encoding: chunked
Date: Thu, 05 Jul 2012 09:05:08 GMT

{
   "taskResource":{
      "resourceURL":"/task/4659c301-13d3-4094-afba-8af05d412bac"
   },
   "downloadURL":null
}

Sample Response 2 (if download is already packaged)

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Pragma: no-cache
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Cache-Control: no-cache
Cache-Control: no-store
Content-Type: application/vnd.pncp.v.5.0+json
Transfer-Encoding: chunked
Date: Thu, 05 Jul 2012 09:05:08 GMT

{
   "taskResource":null
   "downloadURL": ”http://108.55.23.121/download/id=289dfuh2897h98sd?token=345089df092309gd8079”
}

Notes

  • The URL is only valid for 10 seconds after which a new URL would need to be requested.
  • If image to download need to be packaged first, the resultant download URL will be returned in the processDescription field at the end of the transaction.