How to retrieve SDP file via the REST API
To retrieve an SDP file for a specific receiver or sender, you first need to retrieve the ID of the pipeline which contains the receiver or sender. This is found in the pipeline JSON which can be downloaded from the UI as explained in section 2.1. The API call
http://yourserver-IP:80/api/pipeline/\{id\}/state
returns a JSON describing the pipeline state. Find the unique_id field - this is equivalent to the NMOS device_id.. Next, list all receivers or senders with
http://yourserver-IP:80/x-nmos/node/v1.3/receivers
or
http://yourserver-IP:80/x-nmos/node/v1.3/senders
From this list, find the id field of the receiver or sender you are interested in and which has a matching device_id. To distinguish video vs. audio receiver, use the label field. It has a value in the form of “{pipeline_name}/Video” or “{pipeline_name}/Audio#{audio_index}” e.g. “Pipeline/Audio#3”. You can also use the label field to identify a sender. Its label has the form of “{pipeline_name}/{output_stream_name}/Sender” e.g. “Pipeline/Output Stream #1/Sender”.
Now that you have the id of the receiver or sender, you can use the following API calls:
- Receiver - http://yourserver-IP:80/x-nmos/connection/v1.1/single/receivers/\{receiver\_id\}/active
SDP file is in the transport_file field of the JSON response. - Sender - http://yourserver-IP:80/x-nmos/connection/v1.1/single/senders/\{sender\_id\}/transportfile
SDP file is the response body.