media-insights-on-aws
media-insights-on-aws copied to clipboard
Document how to fetch paginated data from dataplane API
In the implementation guide, document how to fetch paginated data from dataplane API. For example:
curl -L -w "%{http_code} %{url_effective}\n" -k -X GET -H 'Content-Type: application/json' -H 'Authorization: '$MIE_ACCESS_TOKEN "$DATAPLANE_API_ENDPOINT/metadata/ebb8d873-ae75-4b92-b632-1bc4b8f37c28/WebCaptions_en" | jq '.cursor'
Also, document how to overwrite data store for a given asset, according to this method:
@app.route('/metadata/{asset_id}', cors=True, methods=['POST'], authorizer=authorizer) def put_asset_metadata(asset_id)
READ:
curl -L -w "%{http_code} %{url_effective}\n" -k -X GET -H 'Content-Type: application/json' -H 'Authorization: '$MIE_ACCESS_TOKEN "$DATAPLANE_API_ENDPOINT/metadata/ebb8d873-ae75-4b92-b632-1bc4b8f37c28/WebCaptions_en"
WRITE:
curl -k POST -H 'Authorization: '$MIE_ACCESS_TOKEN -H "Content-Type: application/json" --data '{"OperatorName": "WebCaptions_en", "Results": {"start":"4.98"}, "WorkflowId": "ebb8d873-ae75-4b92-b632-1bc4b8f37c28"}' $DATAPLANE_API_ENDPOINT/metadata/ebb8d873-ae75-4b92-b632-1bc4b8f37c28
Also document how to get the workflow id for an asset:
curl -L -w "%{http_code} %{url_effective}\n" -k -X GET -H 'Content-Type: application/json' -H 'Authorization: '$MIE_ACCESS_TOKEN $WORKFLOW_API_ENDPOINT/workflow/execution/asset/ebb8d873-ae75-4b92-b632-1bc4b8f37c28 | jq
I'm just going to treat this issue like a list of useful curl commands which would be useful in the docs.
Here's how to get a workflow configuration:
curl -L -w "%{http_code} %{url_effective}\n" -k -X GET -H 'Content-Type: application/json' -H 'Authorization: '$MIE_ACCESS_TOKEN $WORKFLOW_API_ENDPOINT/workflow/configuration/MieCompleteWorkflow2 | jq