Create Transaction
Create a transaction by specifying the number of channels and the model configuration that has to run for these channels. This API will return a transaction ID along with channel IDs, these channel ID

Request

Given below is an example request for creating a new transaction ID using a Marsview AUTHTOKEN. Details for generating Marsview AUTHTOKEN can be found here: generate-token
Param
Description
channels
The number of channels that this transaction will contain. Channel is the number of input sources that would be accessing the real time API. If you want to people to get real time analytics using the same transaction ID, provide the channels key as 2. This value will default to 1 if this parameter is not specified
Bash
1
curl -X POST \
2
https://streams.marsview.ai/rb/v1/streams/setup_realtime_stream \
3
-H 'authorization: Bearer <ATUHTOKEN>' \
4
-H 'cache-control: no-cache' \
5
-H 'content-type: application/json' \
6
-d '{
7
"channels":"2"
8
}'
Copied!

Response

When a request for a transaction is made with the number of Channel ID's. You will get the following response. The response includes the Channel IDs which can be used to initate a stream.
1
{
2
"status": true,
3
"data": {
4
"userId": "[email protected]",
5
"txnId": "txn-6sm91fi3vku2m3fh8-1632744795931",
6
"channels": [
7
{
8
"channelId": "channel-6sm91fi3vku2m3fh9-1632744795931"
9
},
10
{
11
"channelId": "channel-6sm91fi3vku2m3fha-1632744795931"
12
}
13
]
14
}
15
}
Copied!
Last modified 7d ago
Copy link