API

Authentication

Authentication is OAuth2 based. We use AWS Cognito. Refer this url to know how it works

Ask us for the client_id and client_secret by sending an email to support@7targets.com

Get access token

Get a Base64 encoded string of client_id and client_secret.

echo -n 'client_id:client_secret' | openssl base64

Once you have the base64 encoded, you can request the access token with HTTP Basic Authorization header. Like below.

curl -X POST https://login.7targets.com/oauth2/token -H 'authorization: Basic *********48csfderdfZhZ3J***************' -H 'content-type: application/x-www-form-urlencoded' -d 'grant_type=client_credentials&scope=leads%2Fpost'

This should return an access_token, which is a JWT.

{
    "access_token": "*********eyJzdWIiOiIxNGtJU-QMfeFJkN2UgKQ*",
    "expires_in": 3600,
    "token_type": "Bearer"
}

Authorization

Authorization Header for the API calls
Authorization : Bearer <access_token>

User Identifier header 7ts-user-identifier : <value from 7Targets UI>

Request

The headers must include a **valid access_token and 7ts-user-identifier.
Authentication: Bearer <access_token>
7ts-user-identifier : <value from 7Targets UI>


Create a Lead

This method creates or assigns a Lead to the Assistant.

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

The body can’t be empty

{
    name: "John",  //Mandatory
    lastName: "Doe", 
    source: "Website", //Optional. If not provided Website will be used.
    context: "AI Sales Assistant", //Optional. Assistant will write message using this
    additionalInformationLine: "Additional information", 
    email: "john.doe@gmail.com", //Mandatory 
    phone: "+919123456789", //Optional
    assistantEmail : <assistant email to assign> //Mandatory.
    scheduleId : <valid sequence Id>, //Optional. If not provided then scheduleName is used. If that too is not provided then default for the assistant is used.
    scheduleName: <valid sequence name, case sensitive>
    customFields: [{"name": "productName", "value":"Tesla S Model"}]
}

Response

If succeeds, returns the created Lead.

Status: 201 Created

{
    id: 2345,
    name: "John",   
    lastName: "Doe", 
    type: "SALES", 
    email: "john.doe@gmail.com", 
    phone: "+919123456789", 
    scheduleId : <valid sequence Id>,
    scheduleName: <valid sequence name>,
    assistantId : <your assistant Id>,
    nextScheduleTime : <date and time the message will be send>,
    state : Cold,
    subState : Followup,
    followup : 1,
    customFields: [{"name": "productName", "value":"Tesla S Model"}]
}

Update a Lead

This method updates the Lead. Typically when you want to change the lead sequence or any other attribute, you can call this API. Will also update other fields if provided, email id cannot be updated though. If other fields are not provided or if null value provided then those fields are not updated.

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

The body can’t be empty

{
    id: <lead id> //Optional. If not provided email will be used to identify the lead to update.
    name: "John",  //Mandatory
    lastName: "Doe", 
    source: "Website", //Optional. If not provided Website will be used.
    context: "AI Sales Assistant", //Optional. Assistant will write message using this
    additionalInformationLine: "Additional information", 
    email: "john.doe@gmail.com", //Mandatory 
    phone: "+919123456789", //Optional
    assistantEmail : <assistant email to assign> //Mandatory.
    scheduleId : <valid sequence Id>, //Optional. If not provided then scheduleName is used. If that too is not provided then default for the assistant is used.
    scheduleName: <valid sequence name, case sensitive>,
    customFields: [{"name": "productName", "value":"Tesla S Model"}]
}

Response

If succeeds, returns the updated Lead.

Status: 200 Updated

{
    id: 2345,
    name: "John",   
    lastName: "Doe", 
    type: "SALES", 
    email: "john.doe@gmail.com", 
    phone: "+919123456789", 
    scheduleId : <valid sequence Id>,
    scheduleName: <valid sequence name>,
    assistantId : <your assistant Id>,
    nextScheduleTime : <date and time the message will be send>,
    state : Cold,
    subState : Followup,
    followup : 1,
    customFields: [{"name": "productName", "value":"Tesla S Model"}]
}

Stop Followup for the lead

This method stops any scheduled followup for the lead.

url_path: https://api.7targets.com/leads/stop/followup
type: PUT

The body can’t be empty

{
    id: <lead id> //Optional. If not provided email will be used to identify the lead .
    name: "John",  //Mandatory
    lastName: "Doe", 
    source: "Website", //Optional. If not provided Website will be used.
    context: "AI Sales Assistant", //Optional. Assistant will write message using this
    additionalInformationLine: "Additional information", 
    email: "john.doe@gmail.com", //Mandatory 
    phone: "+919123456789", //Optional
    assistantEmail : <assistant email to assign> //Mandatory.
    scheduleId : <valid sequence Id>, //Optional. If not provided then scheduleName is used. If that too is not provided then default for the assistant is used.
    scheduleName: <valid sequence name, case sensitive>
}

Response

If succeeds, returns the updated Lead.

Status: 200 Updated

{
    id: 2345,
    name: "John",   
    lastName: "Doe", 
    type: "SALES", 
    email: "john.doe@gmail.com", 
    phone: "+919123456789", 
    scheduleId : <valid sequence Id>,
    scheduleName: <valid sequence name>,
    assistantId : <your assistant Id>,
    nextScheduleTime : null,
    state : Cold,
    subState : Followup,
    followup : 1,
    customFields: [{"name": "productName", "value":"Tesla S Model"}]
}

Get Assistants

This method gets you a list of your Assistant as a page. Default page size is 10.

url_path: https://api.7targets.com/leads/assistant?searchString=&page=0&size=10&sort=lastModifiedDate,desc
type: GET

Response

If succeeds, returns the List of Assistants.

Status: 200 Updated

[
  {
    "id": 61,
    "name": "Ashley",
    "organisationId": 45,
    "completeSignature": "<p style=\"font-size: 14px; line-height: 16px; margin: 0;\"><strong>Ashley</strong> | <strong style=\"color: rgb(136, 136, 136);\"><em><u>Business Assistant</u></em></strong></p><p style=\"font-size: 14px; line-height: 16px; margin: 0;\"><a href=\"https://7targets.ai\" rel=\"noopener noreferrer\" target=\"_blank\">BMC Software</a> | <a href=\"https://www.7targets.com\" rel=\"noopener noreferrer\" target=\"_blank\">www.7targets.com</a> |<a href=\"https://rahiashutosh.github.io\" rel=\"noopener noreferrer\" target=\"_blank\"> +918209755095</a> | www.7targets.com</p><p style=\"font-size: 14px; line-height: 16px; margin: 0;\"><br></p><p style=\"font-size: 14px; line-height: 16px; margin: 0;\">${NURTURING_LINE}</p>",
    "emailid": "missashley@7targets.7ts-d.com",
    "description": "7Targets AI Assistant is helping the Sales team productivity",
    "role": "BDE",
    "defaultScheduleId": 127,
    "defaultScheduleIdForEmailCC": 3618,
    "perDayEmailLimit": 200
  },
  {
    "id": 135,
    "name": "Lyraa",
    "organisationId": 45,
    "completeSignature": "<p style=\"font-size: 14px; line-height: 16px; margin: 0;\"><strong class=\"ql-font-comicsansms\">Lyra</strong></p><p style=\"font-size: 14px; line-height: 16px; margin: 0;\"><span class=\"ql-font-comicsansms\">Business Development Assistant</span></p><p style=\"font-size: 14px; line-height: 16px; margin: 0;\"><span class=\"ql-font-comicsansms\">7targets.ai</span></p><p style=\"font-size: 14px; line-height: 16px; margin: 0;\"><br></p><p style=\"font-size: 14px; line-height: 16px; margin: 0;\"><span class=\"ql-font-comicsansms\">${NURTURING_LINE}</span></p>",
    "emailid": "lyra@7targets.7ts-d.com",
    "description": null,
    "role": null,
    "defaultScheduleId": 135,
    "defaultScheduleIdForEmailCC": 3619,
    "perDayEmailLimit": 200
  },
×

Subscribe

The latest tutorials sent straight to your inbox.