Skip to content

Async File Python Code - Needs Update #222

Description

@HuckMatt

In the async file submission python code snippet, there are multiple areas where a boolean is expected in the params eg. 'detectPhrases': True,

The way the code snippet is currently written, when the params object is passed in the API request, it is still in the form of a Python dictionary object. Before sending in the request this object needs to be encoded so that the API reads the boolean values as a true boolean.

For example if params = {'detectPhrases': True} then the request:
response = requests.request("POST", url, headers=headers, data=payload, params=params) will return a status 400. The resulting params will be in the form https://api.symbl.ai/v1/process/video?detectPhrases=True

In this example the capitol 'True' will not be accepted by the API and return a status 400.

The correct param format needs to be in the form https://api.symbl.ai/v1/process/video?detectPhrases=true

In order to make this request in python the params object needs to be encoded properly. For example params = json.dumps(params), or in the request response = requests.request("POST", url, headers=headers, data=payload, params=json.dumps(params))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions