API

Authenticate

This method authenticate and returns the Auth token to be used in further API calls.

url_path: https://cognito-idp.us-east-1.amazonaws.com/
type: POST

Request

The body cannot be empty and must be below format.

{
    "AuthParameters" : {
        "USERNAME" : "YOUR_USERNAME or EMAIL",
        "PASSWORD" : "YOUR_PASSWORD"
    },
    "AuthFlow" : "USER_PASSWORD_AUTH", // Don't have to change this if you are using password auth
    "ClientId" : "APP_CLIENT_ID"
}

Ask us for the APP_CLIENT_ID on [email protected]

Response

If success, returns the auth token to be used in further API calls

Status: 200

{
    "AuthenticationResult": {
        "AccessToken": "YOUR_ACCESS_TOKEN",
        "ExpiresIn": "SECONDS",
        "IdToken": "YOUR_ID_TOKEN",
        "RefreshToken": "YOUR_REFRESH_TOKEN",
        "TokenType": "Bearer"
    },
    "ChallengeParameters": {}
}

“IdToken”: “YOUR_ID_TOKEN” is to be used in the further API calls.


Create a Lead

This method creates or assigns a Lead to the Assistant.

url_path: https://api.7targets.com/leads
type: POST

Request

The headers must include a **valid authentication token.
Authentication: Bearer <IdToken from the Auth cal>

The body can’t be empty

{
    name: "John",  //Mandatory
    lastName: "Doe", 
    type: "SALES", //Mandatory
    source: "Website", //Mandatory or other values as available in Source
    context: "AI Sales Assistant", //Assistant will write message using this
    additionalInformationLine: "Additional information", 
    email: "[email protected]", //Mandatory 
    phone: "+919123456789", 
    scheduleId : <valid schedule Id>, //Optional. If not provided then use default
    assistantId : <your assistant Id> //Mandatory
}

Response

If succeeds, returns the created Lead.

Status: 201 Created

{
    id: 2345,
    name: "John",   
    lastName: "Doe", 
    type: "SALES", 
    email: "[email protected]", 
    phone: "+919123456789", 
    scheduleId : <valid schedule Id>,
    assistantId : <your assistant Id>,
    nextScheduleTime : <date and time the message will be send>,
    state : Cold,
    subState : Followup_1
}
×

Subscribe

The latest tutorials sent straight to your inbox.