CamlinAPI Driven CamlinConnect Flow

What are Rest APIs

Camlin REST-based API allows a client to interact and drive a Camlin project call-flow. The APIs are dynamic in nature due to the dynamic nature of each project but the request & response follows a structure that is mentioned in this specification. The API supports different data formats such as json/plain. The specification is written here for the json data format.


How to use Rest APIs

API Specification


  1. Project Flow Trigger API


Endpointhttps://camlinhost/nuassist/rest/in/api/{projectToken}/{flowStartEndpoint}

Request data format : json

Mandatory request params : none

Optional request params : Anything that matches to a Camlin project variable, rest are simply ignored.

Mandatory headers : BASIC auth header. Contact Nuamedia to get this

Optional headers : Anything that matches to a Camlin project variable, rest are simply ignored.

Additional Info : If you are calling the API through a request gateway/proxy, then it is advisable to request to add you gateway/proxy IP address added to allowed hosts list. If you don't do so then your API endpoint is open to the world and it is your responsibility to protect the endpoint URL.

Response

Headers :
Authorization : Basic {hash}
Data : 

{
options : [
{
name : "Flow option1 name",
description : "Flow option1 description",
endpoint : "/option1Endpoint"
requiredParams : ["param1","param2",...],
requiredHeaders : ["header1","header2",...]
},
{
name : "Flow option2 name",
description : "Flow option2 description",
endpoint : "/option2Endpoint"
requiredParams : ["param1","param2",...],
requiredHeaders : ["header1","header2",...]
},
...
]

info : [
{
content : "endpoint response content like text/html/etc"
},
{
content : "This is my welcome text"
}
...
]
}


2. Options Trigger API


Endpointhttps://camlinhost/nuassist/rest/in/api/{projectToken}/{optionEndpoint}

Request data format : json

Mandatory request params : none

Optional request params : Anything that matches to a Camlin project variable, rest are simply ignored.

Mandatory headers : BASIC auth header. Contact Nuamedia to get this

Optional headers : Anything that matches to a Camlin project variable, rest are simply ignored.

Additional Info : If you are calling the API through a request gateway/proxy, then it is advisable to request to add you gateway/proxy IP address added to allowed hosts list. If you don't do so then your API endpoint is open to the world and it is your responsibility to protect the endpoint URL.

Response

Headers :
Authorization : Basic {hash}
Data : 

{
options : [
{
name : "Flow option4 name",
description : "Flow option1 description",
endpoint : "/option3Endpoint"
requiredParams : ["param1","param2",...],
requiredHeaders : ["header1","header2",...]
},
{
name : "Flow option4 name",
description : "Flow option4 description",
endpoint : "/option4Endpoint"
requiredParams : ["param1","param2",...],
requiredHeaders : ["header1","header2",...]
},
name : "Flow option2 name",
description : "Flow option2 description",
endpoint : "/option4Endpoint"
requiredParams : ["param1","param2",...],
requiredHeaders : ["header1","header2",...]
},
...
]

info : [
{
content : "endpoint response content like text/html/etc"
},
{
content : "This is a human readable text for the endpoint result"
}
...
]
}