media-insights-on-aws icon indicating copy to clipboard operation
media-insights-on-aws copied to clipboard

Document how to fetch paginated data from dataplane API

Open ianwow opened this issue 4 years ago • 3 comments

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'

ianwow avatar Apr 16 '20 22:04 ianwow

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

ianwow avatar Apr 17 '20 19:04 ianwow

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

ianwow avatar Apr 18 '20 03:04 ianwow

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

ianwow avatar Apr 20 '20 17:04 ianwow