Use cURL
cURL is an open source, command-line tool for transferring data with URL syntax, supporting various protocols including HTTPS. The examples in this document use cURL to demonstrate how to access the Cloud Native Session Border Controller REST API, but you can use any programming language capable of sending and receiving HTTPS requests.
To use cURL to access the Cloud Native Session Border Controller REST API:
-
Invoke cURL and specify one or more of the command-line options defined in the following table.
cURL Option Description --cacert
Specifies the location of the CA certificate bundle on the local machine. -d, --data @file.json
Identifies the request document, in JSON format, on the local machine. -H, --header
Defines one or more of the following: - Content-Type header
- Accept header
- Authorization header
- Authentication header
-i
Displays response header information. -u, --user username:password
Specifies the user name and password for an account on the Cloud Native Session Border Controller. Used only when requesting an authentication token. -X
Indicates the type of request, such as GET, POST, DELETE, or PUT.
For example:
curl -i -X GET --cacert /path/to/bundle -u <username>:<password> -H <request-header>:<value> https://<IP address>/<path>/<resource-path>
All JSON responses contains the following structure:
{ "response": { "data": "", "messages": "", "links": "" } }
To reuse the data from one GET request in another request, extract the contents of "data" element.
When appropriate, the "messages" section contains errors or warnings and the "links" section contains links to other REST URIs.