Skip to content

Authentication

Use this API to register client callback Authentication methods using oAuth or Basic Authentication.

Create Authentication

Request

Overview

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.

Scope

Client application must have 'app.conversation.conversationmgr.manage' scope assigned.

Security
oAuthClient(Required scopes:
https://api.egain.cloud/auth/.de...
)
Bodyapplication/json

Register new authentication type

One of:

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

namestring, [ 1 .. 255 ] charactersrequired

Unique name for authentication method

descriptionstring, [ 1 .. 1023 ] characters
activeboolean
Default:true
typestringrequired

Type of authentication

Value:"oauth2"
Example:"oauth2"
oauth2objectrequired

OAuth type authentication

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"
    }
  }'

Responses

Created

Bodyapplication/json
idstring, = 36 characters

UUID generated for the object.

Response
{ "id": "34fbb53f-ed7f-48d4-b545-e26cc95e075d" }