Initiate streaming task

Use this with the streaming API

This call is made by a client wanting to initiate a new streaming job when using the streaming API. Please refer to Getting started for more information and the context in which this call is used. The endpoint is:

The client ID of Oliver API service user must be provided as a path parameter (long: {cid}). The cid is assigned when the customer first registers for the service. Apart from this required field, the user must provide the number of channels that the audio stream contains, single or two channels (int: channels) and the type of call (incoming vs. outgoing). Optional information about the incoming request can be provided via additional query parameters. It is highly recommended to provide as many of these metadata fields as possible to improve service performance. The agent ID (string: agentId), agent’s team (string: agentTeam), customer ID (string: customerId), customer industry (string: customerInd) and campaign ID (string: campaignId) can be provided on the request as query parameters. It is possible to provide a name for the job (string: name), the ANI associated with the call (string: ANI), the call type (string: calltype), the call time (datetime: calltime) and timezone (int: timezone).

It is possible to also send a tasks object (string: tasks) as a query parameter in order to configure the processing request. Oliver API currently supports 2 tasks for a live request: a) raw streaming outputs and b) alerts. The "stream" task is activated while the "alerts" task is deactivated by default. In order to change this configuration, the value of the tasks parameter should be a stringified, url-encoded JSON object complying with the following schema:

RequestTasks:
	type: array
  items:
    type: object
    properties:
      name:
        description: Name of task
        type: string
        enum:
          - alerts
          - stream
      options:
        description: Task options
        type: object
        properties:
          activate:
            description: Whether to activate the task operation
            type: boolean

For example, sending the tasks value:

[{"name": "stream", "options": {"activate": false}}, {"name": "alerts", "options": {"activate": true}}]

will deactivate raw streaming responses and only return alerts.

When the request is sent to the API service, the user will get a JSON response that will either contain the new process that was inserted in the system for processing in case of success or an error code in case an error occurred. On successful insertion, the response contains the unique process ID (long: id) given by the system that is necessary for the user to access the state and the result of the processing. It also includes the fields that were given by the user, fields that show the state of processing and results fields that are set to default values and will be updated during processing by the system.
In case a new incoming request cannot be inserted into the system for processing, an error is returned so the user is informed that their request failed and should be re-submitted later. An example error response, in case the system cannot queue the incoming job, is the following:

{"code":503,"message":"The service is not available at the moment. Please try again later."}