For the sake of simplifying the Coconut API, we decided to group all the Ping parameters into one new, single
ping_url. So now, instead of setting the
ping_url_if_error, you just need to set one
ping_url in your Download and Job requests.
A short example:
curl -u HW-API-Key:apikey -X POST \ -d "video_id=19072468" \ -d "format_id=iphone_720p" \ -d "keep_video_size=true" \ -d "output_url=s3://accesskey:secretkey@bucket/my/object/file.mp4" \ -d "ping_url=http://mysite.com/coconut/ping" \ http://coconut.com/job.json
The HTTP URL you specified in the
ping_url parameter will receive either success or error notification.
All in One Script
It is a slightly different approach, because all the different Pings are handled in a single script. This is why we have added a new POST parameter,
coconut_ping_type, that comes along with the HTTP request so you know exactly what just happened.
Here are the different event types you may receive:
transferA video transfer has completed
encodeA video has finished being encoded
cdn_uploadThe encoded video has been uploaded to the given Output URL
thumbnailsThumbnail generation and upload have completed
To learn more, you can read the Ping Principle article that includes a comprehensive example of a Ping script that handles all of the types of Pings.
What happens to the other Ping parameters?
ping_url_* parameters won't go anywhere and will continue to work but you are encouraged to use the new
Any Comment? Contact us via our contact page