Use this API to register client callback Authentication methods using oAuth or Basic Authentication.
- Conversation Manager
- V3
Conversation Manager APIs
This section provides the requisite APIs needed to create Conversation Manager accounts and to configure conversation workflows. To create the Conversation Manager acccount, use the Conversation APIs in this order when setting up a complete eGain application:
- Authentication
- Client Application
- Participant
- Channel
- Orchestration
- Account
After the account is created you can use the following APIs to send / receive messages.
- Conversation
- Asset
Note: You can configure your system to use third party Bots and third party Channels. The API instructions provided here assume you are using eGain's application setup.
Request
Use this API to register client callback Authentication methods using oAuth or Basic Authentication. This is the first step in creating a new Conversation Account. New Account API process flow: Authenticiation > Client Application > Participant > Channel > Orchestration > Account Use the ID returned in the response when creating the client application. The Conversation Manager also uses this authentication method when sending messages to the callback URL of the client application.
Client application must have 'app.conversation.conversationmgr.manage' scope assigned.
Register new authentication type
OAuth type authentication for callback APIs specified in Client application. Conversation Hub will generate token using this API and use it until it receives 401 from callback API
- Production Serverhttps://api.egain.cloud/conversation/conversationmgr/v3/authentications
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
- OAuth
- Basic Auth
curl -i -X POST \
https://api.egain.cloud/conversation/conversationmgr/v3/authentications \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"name": "custom_bot_callback_authentication",
"type": "oauth2",
"oauth2": {
"tokenRequestUrl": "https://example.com/accesstoken",
"method": "POST",
"headers": [
{
"name": "Content-Type",
"value": "application/json"
},
{
"name": "Accept",
"value": "application/json"
}
],
"payload": "{ \"clientId\": \"74513d54e112464ea8e69d3d639d0c94\",\"clientSecret\": \"nv1GRtTAL1OcKdqKZrQBb5AqQNilgaitr@JYtsdYZvLbCHx8dRjZeCPENmo8\"}",
"accessTokenPath": "$.accessToken"
}
}'{ "id": "34fbb53f-ed7f-48d4-b545-e26cc95e075d" }
- Production Serverhttps://api.egain.cloud/conversation/conversationmgr/v3/authentications
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
https://api.egain.cloud/conversation/conversationmgr/v3/authentications \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>'OK
{ "authentication": [ { … }, { … } ] }
- Production Serverhttps://api.egain.cloud/conversation/conversationmgr/v3/authentications/{id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
https://api.egain.cloud/conversation/conversationmgr/v3/authentications/7b6c5fff-036e-4a40-b68a-a67c592fc079 \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>'{ "id": "34fbb53f-ed7f-48d4-b545-e26cc95e075d", "name": "custom_bot_callback_authentication", "type": "oauth2", "oauth2": { "tokenRequestUrl": "https://acme.support.com/clientapp/accesstoken", "method": "POST", "headers": [ … ], "payload": "{ \"clientId\": \"c987cbfc-d59c-11ea-87d0-0242ac130003\",\"clientSecret\": \"c987cde6-d59c-11ea-87d0-0242ac130003\",\"refreshToken\": \"c987cee0-d59c-11ea-87d0-0242ac130003\"}", "accessTokenPath": "$.accessToken" }, "created": "2021-03-28T14:29:01.516Z", "modified": "2021-03-28T14:29:01.516Z" }
Update authentication type
OAuth type authentication for callback APIs specified in Client application. Conversation Hub will generate token using this API and use it until it receives 401 from callback API
- Production Serverhttps://api.egain.cloud/conversation/conversationmgr/v3/authentications/{id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X PUT \
https://api.egain.cloud/conversation/conversationmgr/v3/authentications/7b6c5fff-036e-4a40-b68a-a67c592fc079 \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"name": "custom_bot_callback_authentication",
"type": "oauth2",
"oauth2": {
"tokenRequestUrl": "https://acme.support.com/clientapp/accesstoken",
"method": "POST",
"headers": [
{
"name": "Content-Type",
"value": "application/json"
},
{
"name": "Accept",
"value": "application/json"
}
],
"payload": "{ \"clientId\": \"c987cbfc-d59c-11ea-87d0-0242ac130003\",\"clientSecret\": \"c987cde6-d59c-11ea-87d0-0242ac130003\",\"refreshToken\": \"c987cee0-d59c-11ea-87d0-0242ac130003\"}",
"accessTokenPath": "$.accessToken"
},
"modified": "2021-03-28T14:29:01.516Z"
}'- Production Serverhttps://api.egain.cloud/conversation/conversationmgr/v3/authentications/{id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X DELETE \
https://api.egain.cloud/conversation/conversationmgr/v3/authentications/7b6c5fff-036e-4a40-b68a-a67c592fc079 \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>'