Postbacks are the callbacks that Blitline makes to YOUR application when Blitline has finished executing a job. Since Blitline jobs are asynchronous (they are done on multiple threads, concurrently), you cannot simply submit a job and get a completed job JSON back. This is where postbacks come in... we can notify you as soon as we are finished with a job. This is the PREFERRED method over polling.
Postbacks are guaranteed to happen, even if there is an error. You will always be called back when a job completes.
You define where we send your job information. Nobody has access to the data except the postback endpoint.
Polling is not a scaling solution for either of us. We cannot handle infinity connections for polling, so if there are no connections for polling, you won't be able to poll. Postbacks are GUARANTEED because they are 1 single call from us to you.
Your code gets called as soon as the job is completed. Before our jobs have even exited, you app can be taking the data and running with it. This means postbacks are the fastest possible solution for your app.
What JSON gets posted back?(or returned with long polling)
Postbacks are http calls that Blitline ’POST’s back to your server, notifying you that the image has completed.
- resultsRoot node(required: 1 time)
- job_idOriginal id returned by the job submission(required: 1 time)
- original_metaThe metadata associated with the original photo(required: 1 time)
- widthWidth of original image(required: 1 time)
- heightHeight of original image(required: 1 time)
- imagesThe list of images processed by Blitline(required: 1 time[
- image_identifierImage identifier you submitted with JSON with original job(required: 1 time)
- s3_urlDestination url of image(optional: 1 time)
- metaMetadata about image(optional: 1 time)
- widthWidth of image(optional: 1 time)
- heightHeight of image(optional: 1 time)
- latLatitude of image (if available)(optional: 1 time)
- lngLongitude of image (if available)(optional: 1 time)
- extended_metaBlob (string) of data represnting all the metadata stored in original image(optional: 1 time)
If failed to process ("v" > 1.19)
- errorsText associated with error that occurred(required: 1 time)
- failed_image_identifiersArray of image_identifiers that were not completed(required: 1 time)
Postbacks are more effort than just polling... we know. The concept is simple, though. You give us a URL to call when we are done processing a job. Simple, right?
How can I give you a URL when I'm developing on my local machine?
We have two answers for this...Option #1
I don't have a server to call back too, how can I use a postback?
OK, well you've got us there... In this case you options are limited. BUT, there is a better answer than polling us...Option #1