Salesflow authentication by API in Notion

VersionDescription
1.0Add “GetCampaignStatistics” endpoint
1.1Add “ImportMember” endpoint
1.2Add “UpdateContact” endpoint
1.2Add “GetContact” (by memberId) endpoint
1.2Add “DeleteContact” endpoint
1.2Add “ListContacts” (by campaignId) endpoint
1.2Add “ListCampaigns” endpoint
1.3Add “GetContact” (by public identifier) endpoint
1.3Add “ListContacts” (by public identifiers) endpoint
1.4 Add “ListAccounts” endpoint
1.5 Add “CreateWebhook” endpoint
1.5 Add “DeleteWebhook” endpoint
1.5 Add “ListWebhooks” endpoint
1.5 Add “AttachWebhook” endpoint
1.5 Add “DetachWebhook” endpoint
1.5Update “ImportMember” endpoint — return created member
1.6 Extend response for “GetContact” endpoint
1.7Update “ListCampaigns” endpoint — return campaign status
1.7Add “Start campaign” endpoint
1.8Update “ListContact” (by public identifiers & campaign id) endpoints – add
filter by “UpdatedFromDate”)
1.8Add “Company”, “MemberUrl”, “LastModifiedAt”, “AddedAt” fields to endpoints which returns member information.
1.9Add “UserDbId”& “UserEmail”properties to the “ListAccounts” endpoint
1.9Add “LastModifiedAt” property to campaigns response for “ListCampaigns”
endpoint
1.9Update “ListCampaigns” endpoint – add filter by “UpdatedFromDate”)

Webhooks

Webhooks allow to make outgoing calls from Salesflow to any external site by URL, provided by the 3rd-party site. Webhooks can be configured on the campaign settings page under “Integrations” section and are triggered by one of the following events:

  MEMBER_CONNECTEDthe system has identified that a given campaign member 
changed his status toCONNECTED
  REPLY_DETECTEDthe system has identified an incoming message from a 
given contact. Not called if a given contact is muted
  INVITATION_WITHDRAWNthe system has successfully withdrawn an invitation 
for a given contact

Data sample

The data sent by the system is a regular POST request, containing a normal JSON as the request body. The following data sample illustrates this:

{
    "IntegrationType": "INTEGRATION_TYPE_WEBHOOK",
    "IntegrationRunOn": "INTEGRATION_RUN_ON_CONNECTED",
    "MemberId": 0,
    "LinkedInMemberId": 1234567890,
    "FirstName": "John",
    "LastName": "Smith",
    "Occupation": "Founder and Chief Executive Officer at Smith & Co",
    "Company": "Smith & Co",
    "Location": "Miami/Fort Lauderdale Area",
    "PhoneNumber": "123 4567890",
    "Email": "[email protected]",
    "Address": "",
    "BirthdayYear": 1980,
    "BirthdayMonth": 12,
    "BirthdayDay": 1,
    "DateAdded": "2021-02-18T15:33:44.5905705+00:00",
    "ConnectedAt": "2021-02-18T16:33:44.5905705+00:00",
    "MemberUrl": "https://linkedin.com/in/john-smith-123321",
    "Industry": "Banking",
    "Distance": "DISTANCE_3",
    "CurrentPosition": "Chief Executive Officer",
    "Status": "MEMBER_CONNECTED",
    "HasReply": false,
    "IsMuted": false,
    "IsSeen": false,
    "ConnectionsCount": 100,
    "FollowersCount": 100,
    "IsSalesNavigator": false,
    "LinkedInAccount": {
        "FirstName": "Bob",
        "LastName": "White",
        "Username": "[email protected]"
    },
    "Custom1": "CustomValue1",
    "Custom2": "CustomValue2",
    "Custom3": "CustomValue3",
    "Custom4": "CustomValue4",
    "Custom5": "CustomValue5",
    "Custom6": "CustomValue6",
    "Custom7": "CustomValue7",
    "Custom8": "CustomValue8",
    "Custom9": "CustomValue9",
    "Custom10": "CustomValue10",
    "MemberActionsFormatted": "<p>Connection message [2/18/2021 4:33 PM]: This is a test co
nnection message</p>\r\n\r\n<p>John Smith [2/18/2021 4:33 PM]: This is a test inbound messa
ge</p>",
    "MemberCampaigns": [
        {
            "CampaignName": "Test campaign"
        }
    ]
}

API Calls

API calls allow any 3rd party system to interact with our system. Currently we support a very basic set of methods, however, we are going to significantly expand this functionality very soon.

GetCampaignStatistics

This method retrieves campaign statistics for a given campaignId

Endpoint: https://app.salesflow.io/api/

Resource: statistics/GetCampaignStatistics

Parameters:

  accountId – selected accountId
  campaignId – selected campaignId
  token – API token, obtained for selected accountId

Example: https://app.salesflow.io/api/statistics/GetCampaignStatistics?campaignId=12345&accountId=321&token=abcdefghijklmnop123

{
    "CampaignId": 31767,
    "Total": 555,
    "InMails": 0,
    "Imported": 2,
    "Connections": 1,
    "Messages": 0,
    "Pending": 552,
    "Replies": 0,
    "Withdrawn": 0,
    "Invitations": 0,
    "UpdatedAt": "/Date(1618336539820)/",
    "Elapsed": 3.5381
}

ImportMember

This method allows to add a new contact (campaign member) to a given campaign (the same can be done with CSV import feature)

Endpoint: https://mvc.salesflow.io/api/

Resource: members/Import

Parameters:

	accountId – selected accountId
  campaignId – selected campaignId
  token – API token, obtained for selected accountId
  linkedInUrl – LinkedIn profile URL of a contact to be added
  (optional): firstName, lastName, occupation, location

Example: https://mvc.salesflow.io/api/members/Import?campaignId=12345&accountId=321&token=abcdefghijklmnop123&linkedInUrl=https://linkedin.com/in/john-smith-123456&firstName=John&lastName=Smith&occupation=CEO&location=US

UpdateContact

This method allows to update an existing contact (campaign member)

Endpoint: https://mvc.salesflow.io/api/

Method: POST

Resource: members/{memberId}

Query Parameters:

  memberId – selected memberId
  accountId – selected accountId
  token – API token, obtained for selected accountId

Body Parameters:

  firstName – first name, maximum length = 63
  lastName – last name, maximum length = 63
  location –  location, maximum length = 127
  occupation – occupation, maximum length = 1023
  industry – industry, maximum length = 1023
  email – email, maximum length = 1023
  phone – phone, maximum length = 1023

Example:

curl 'https://mvc.salesflow.io/api/members/46875434?token=abcdefghijklmnop123&accountId=321' \

--header 'Content-Type: application/json' \
--data-raw '{
    "lastName": "Doe",
    "FirstName": "John",
    "Location": "New York",
    "Occupation": "CEO",
    "Industry": "marketing",
    "Email": "[email protected]",
    "Phone": "1555123458"
}'

Sample Data Response:

{
    "MemberId": 46875434,
    "FirstName": "John",
    "LastName": "Doe",
    "Location": "New York",
    "Occupation": "CEO",
    "Industry": "marketing",
    "Email": "[email protected]",
    "Phone": "1555123456",
    "PublicIdentifier": "identity100",
    "Company": "some company",
    "MemberUrl": "https://www.linkedin.com/in/test123",
    "LastModifiedAt": "2024-04-21T09:41:06.17",
    "AddedAt": "2024-05-21T09:41:06.17"
}

GetContact (by memberId)

This method allows to get contact (campaign member)

Endpoint: https://mvc.salesflow.io/api/

Method: GET

Resource: members/{memberId}

Parameters:

  memberId – selected memberId
  accountId – selected accountId
  token – API token, obtained for selected accountId

Example:

https://mvc.salesflow.io/api/members/46875434?token=abcdefghijklmnop123&accountId=321

Sample Data Response:

{
    "MemberId": 46875434,
    "FirstName": "John",
    "LastName": "Doe",
    "Location": "New York",
    "Occupation": "CEO",
    "Industry": "marketing",
    "Email": "[email protected]",
    "Phone": "1555123456",
    "PublicIdentifier": "identity100",
    "Status": "MEMBER_PENDING, MEMBER_ERROR",
    "CampaignId": 10,
    "CampaignName" : "Sale lead",
    "Company": "some company",
    "MemberUrl": "https://www.linkedin.com/in/test123",
    "LastModifiedAt": null,
    "AddedAt": "2024-05-21T09:41:06.17"
  }

CampaignId property can be null.
Status property Is bit field and can have next values:

  MEMBER_NOT_SET = 0
  MEMBER_PENDING = 1
  MEMBER_INVITATION_SENT = 2
  MEMBER_CONNECTED = 4
  MEMBER_DISCONNECTED = 8
  MEMBER_DELETED = 16
  MEMBER_IMPORTED = 32
  MEMBER_INVITATION_WITHDRAWN = 64
  MEMBER_ERROR = 1024
  MEMBER_DUPLICATE = 2048

Technically, all bits except MEMBER_ERROR or MEMBER_DUPLICATE should not be set in same time.

GetContact (by public identifier)

This method allows to get contact (campaign member)

Endpoint: https://mvc.salesflow.io/api/

Method: GET

Resource: members

Parameters:

  memberId – selected memberId
  accountId – selected accountId
  token – API token, obtained for selected accountId

Example:

https://mvc.salesflow.io/api/members?publicIdentifier=identity500&token=abcdefghijklmnop123&accountId=321

Sample Data Response:

{
    "MemberId": 46875434,
    "FirstName": "John",
    "LastName": "Doe",
    "Location": "New York",
    "Occupation": "CEO",
    "Industry": "marketing",
    "Email": "[email protected]",
    "Phone": "1555123456",
    "PublicIdentifier": "identity100",
    "Company": "some company",
    "MemberUrl": "https://www.linkedin.com/in/test123",
    "LastModifiedAt": "2024-04-21T09:41:06.17",
    "AddedAt": "2024-05-21T09:41:06.17"
}

DeleteContact

This method allows to delete contact (campaign member)

Endpoint: https://mvc.salesflow.io/api/

Method: DELETE

Resource: members/{memberId}

Parameters:

  publicIdentifier – member’s public identifier
  accountId – selected accountId
  token – API token, obtained for selected accountId

Example: 

curl -- request DELETE 'https://mvc.salesflow.io/api/members/46875434?token=abcdefghijklmnop123&accountId=321'

Sample Data Response:

{
    "Status": 204,
    "Message": null
}

ListContacts (by public identifiers)

This method allows to get a list of available contacts by provided public identifiers

Endpoint: https://mvc.salesflow.io/api/

Method: POST

Resource: members/list-contacts

Query parameters:

  accountId – selected accountId
  token – API token, obtained for selected accountId

Body Parameters:

  PublicIdentifiers – Collection of public identifiers
  UpdatedFromDate – optional, Date

Publicidentifiers collection can’t be null or empty. Collection can have more than 20 elements. Every element of ‘Publicidentifiers’ collection can’t be null or empty.

If UpdatedFromDate is present, result will contain only members which were updated after provided date

Example:

curl 'https://mvc.salesflow.io/api/list-contacts?token=abcdefghijklmnop123&accountId=321' \
--header 'Content-Type: application/json' \
--data-raw '{
    "PublicIdentifiers":  [
       "identity1",
       "identity2",
       "identity3" ],
    "UpdatedFromDate": "2022-07-29 06:45:15"
 }’

Sample Data Response:

[
  {
        "MemberId": 46875434,
        "FirstName": "John",
        "LastName": "Doe",
        "Location": "New York",
        "Occupation": "CEO",
        "Industry": "marketing",
        "Email": "[email protected]",
        "Phone": "1555123456",
        "PublicIdentifier": "identity1",
        "Company": "some company",
        "MemberUrl": "https://www.linkedin.com/in/test123",
        "LastModifiedAt": "2024-04-21T09:41:06.17",
        "AddedAt": "2024-05-21T09:41:06.17"
    },
    {
        "MemberId": 46875435,
        "FirstName": "Nick",
        "LastName": "Foo",
        "Location": "London",
        "Occupation": "Full stack .NET developer, open for new opportunities",
        "Industry": null,
        "Email": null,
        "Phone": null,
        "PublicIdentifier": "identity3",
        "Company": "some company",
        "MemberUrl": "https://www.linkedin.com/in/test456",
        "LastModifiedAt": "2024-03-21T09:41:06.17",
        "AddedAt": "2024-03-21T09:41:06.17"
    }
]

ListContacts (by campaignId)

This method allows to get a list of available contacts (campaign members) for a selected campaign

Endpoint: https://app.salesflow.io/api/

Method: GET

Resource: members/list-contacts

Parameters:

  accountId – selected accountId
  campaignId – selected campaignId
  token – API token, obtained for selected accountId
  updatedFromDate – optional, Date        

If UpdatedFromDate is present, result will contain only members which were updated after provided date

Example: https://mvc.salesflow.io/api/members/list-contacts?accountId=321&token=abcdefghijklmnop123&campaignId=456&updatedFromDate=2024-04-21T09:41:06

Sample Data Response:

[
  {
        "MemberId": 46875434,
        "FirstName": "John",
        "LastName": "Doe",
        "Location": "New York",
        "Occupation": "CEO",
        "Industry": "marketing",
        "Email": "[email protected]",
        "Phone": "1555123456",
        "Company": "some company",
        "MemberUrl": "https://www.linkedin.com/in/test456",
        "LastModifiedAt": "2024-03-21T09:41:06.17",
        "AddedAt": "2024-03-21T09:41:06.17"
    },
    {
        "MemberId": 46875435,
        "FirstName": "Nick",
        "LastName": "Foo",
        "Location": "London",
        "Occupation": "Full stack .NET developer, open for new opportunities",
        "Industry": null,
        "Email": null,
        "Phone": null,
        "Company": "some company",
        "MemberUrl": "https://www.linkedin.com/in/test456",
        "LastModifiedAt": "2024-03-21T09:41:06.17",
        "AddedAt": "2024-03-21T09:41:06.17"
    }
]

ListCampaigns

This method allows to get a list of available campaigns

Endpoint: https://mvc.salesflow.io/api/

Method: GET

Resource: campaigns/list-campaigns

Parameters:

  accountId – selected accountId
  token – API token, obtained for selected accountId
  UpdatedFromDate – optional, Date        
  Campaign can have one of statuses:
  CAMPAIGN_RUNNING – campaign is running right now
  CAMPAIGN_PAUSED – campaign will be started in scheduled time
  CAMPAIGN_STOPPED – campaign is stopped and never be started automatically

Example: https://mvc.salesflow.io/api/campaigns/list-campaigns?accountId=321&token=abcdefghijklmnop123

Sample Data Response:

[
    {
        "CampaignId": 29854,
        "CampaignName": "Sales",
        "Status": "CAMPAIGN_RUNNING",
        "LastModifiedAt": null    
    },
    {
        "CampaignId": 29889,
        "Status": "CAMPAIGN_RUNNING",
        "CampaignName": "Java developers",
        "LastModifiedAt": "2024-07-16T06:59:05.62"    
    }
]

Example: filter by date 2024-07-16T05:00:00 https://mvc.salesflow.io/api/campaigns/list-campaigns?accountId=321&token=abcdefghijklmnop123updatedFromDate=2024-07-16T05%3A00%3A00

Sample Data Response:

[
    {
        "CampaignId": 29889,
        "Status": "CAMPAIGN_RUNNING",        
        "CampaignName": "Java developers",
        "LastModifiedAt": "2024-07-16T06:59:05.62"     
    }
]

Start campaign

This method allows to start campaign

Endpoint: https://mvc.salesflow.io/api/

Method: POST

Resource: campaigns/start

Parameters:

  campaignId – selected campaignId
  accountId – selected accountId
  token – API token, obtained for selected accountId

Example:

curl  --request POST 'https://mvc.salesflow.io/api/campaigns/start?
token=abcdefghijklmnop123&accountId=321&campaignId=456'  -d {}

Sample Data Response:

{
    "Status": 200,
    "Message": "Campaign has been started."
}

Possible status codes:

200 Campaign was started successfully
403 Invalid token/account
404 Campaign not found
409 Campaign is already running
422 Campaign cant be started. Message can contain reason.

List Accounts

This method allows to get a list of available accounts

Endpoint: https://mvc.salesflow.io/api/

Method: GET

Resource: accounts/list

Parameters:

  token – API token

Example: https://mvc.salesflow.io/api/accounts/list?token=abcdefghijklmnop123

Sample Data Response:

[
    {
        "AccountId": 10,
        "AccountEmail": "[email protected]",
        "Status": "ACCOUNT_BLOCKED",
        "UserDbId": "f8de222f-f6e9-4d5b-a7fe-3ff5e0680c66",
        "UserEmail": "salesflow_user_email@some_host.com"
    },
    {
        "AccountId": 11,
        "AccountEmail": "[email protected]",
        "Status": "ACCOUNT_ACTIVE",
        "UserDbId": "f8de222f-f6e9-4d5b-a7fe-3ff5e0680c66",
        "UserEmail": "salesflow_user_email@some_host.com"
    }
]

Campaign can have one of statuses:

  CAMPAIGN_RUNNING – campaign is running right now
  CAMPAIGN_PAUSED – campaign will be started in scheduled time
  CAMPAIGN_STOPPED – campaign is stopped and never be started automatically

CreateWebhook

This method allows to create a webhook

Endpoint: https://mvc.salesflow.io/api/

Method: GET

Resource: webhooks/create

Parameters:

  accountId – selected accountId
  token – API token, obtained for selected accountId

Body Parameters:

  Name – webhook name, required, maximum length = 255
  Url – webhook url, required, maximum length = 511
  DisableForMutedContacts –  optional, nullable boolean, if true – will not 
  triggered for muted contacts

Example:

curl 'https://mvc.salesflow.io/api/webhooks/create?token=abcdefghijklmnop123&accountId=321' \
--header 'Content-Type: application/json' \
--data-raw '{
    "Name": "Doe",
    "Url": "https://www.somesite.com/abc"
}'

Sample Data Response:

{
    "WebhookId": 10265,
    "Name": "Doe",
    "Url": "https://www.somesite.com/abc",
    "DisableForMutedContacts": null,
    "AttachedWebhookCampaigns": []
}

DeleteWebhook

This method allows to delete webhook.

Endpoint: https://mvc.salesflow.io/api/

Method: DELETE

Resource: webhooks/delete

Parameters:

  webhookId – selected webhookId
  accountId – selected accountId
  token – API token, obtained for selected accountId

Example:

curl --request DELETE 'https://mvc.salesflow.io/api/webhooks/delete?token=123&accountId=456&webhookId=789'

Sample Data Response:

{
    "Status": 204,
    "Message": null
}

ListWebhooks

This method allows to get a list of available webhooks

Endpoint: https://mvc.salesflow.io/api/

Method: GET

Resource: webhooks/list

Parameters:

  accountId – selected accountId
  token – API token, obtained for selected accountId

Example: https://mvc.salesflow.io/api/webhooks/list?accountId=321&token=abcdefghijklmnop123

Sample Data Response:

[
    {
        "WebhookId": 8984,
        "Name": "SomeCoolName",
        "Url": "https://www.somehost.com/abc",
        "DisableForMutedContacts": false,
        "AttachedWebhookCampaigns": [
            {
                "WebhookCampaignId": 17745,
                "CampaignId": 29124,
                "RunOn": 1
            },
            {
                "WebhookCampaignId": 17746,
                "CampaignId": 29124,
                "RunOn": 2
            },
            {
                "WebhookCampaignId": 17747,
                "CampaignId": 29124,
                "RunOn": 7
            }
            {
                "WebhookCampaignId": 17812,
                "CampaignId": 29130,
                "RunOn": 2
            }
        ]
    },
    {
        "WebhookId": 8985,
        "Name": "AnotherCoolName",
        "Url": "https://www.somehost.com/def",
        "DisableForMutedContacts": null,
        "AttachedWebhookCampaigns": []
    },
]

AttachedWebhookCampaigns property is a collection which contain next information:

  • CampaignId – Campaign identifiers
  • WebhookCampaignId – WebhookCampaignId identifier. This value should be used to detach integration.
  • RunOn – Selected event type (MEMBER_CONNECTED, REPLY_DETECTED, INVITATION_WITHDRAWN)

AttachWebhook

This method allows to attach webhook to campaign

Endpoint: https://mvc.salesflow.io/api/

Method: POST

Resource: webhooks/attach

Query Parameters:

  accountId – selected accountId
  webhookId – selected webhookId
  campaignId – selected campaignId
  runOn – selected event type (integer)
  token – API token, obtained for selected accountId

Property runOn can have next values

  • 1 – MEMBER_CONNECTED – the system has identified that a given campaign member changed his status to “CONNECTED”
  • 2 – REPLY_DETECTED – the system has identified an incoming message from a given contact. Not called if a given contact is muted
  • 7 – INVITATION_WITHDRAWN – the system has successfully withdrawn an invitation for a given contact.

Every integration can be attached up to 3 times per campaign, but with different “runOn” parameter.

Example:

curl  --request POST 'https://mvc.salesflow.io/api/webhooks/attach?token=abcdefghijklmnop123&accountId=321&webhookId=456&runOn=2&campaignId=789' -d {}

Sample Data Response:

{
    "WebhookCampaignId": 27830,
    "CampaignId": 789,
    "RunOn": 2
}

DetachWebhook

This method allows to detach webhook from campaign

Endpoint: https://mvc.salesflow.io/api/

Method: POST

Resource: webhooks/detach

Query Parameters:

  accountId – selected accountId
  webhookCampaignId – selected webhookCampaignId
  token – API token, obtained for selected accountId

Example:

curl  --request POST 'https://mvc.salesflow.io/api/webhooks/detach?token=abcdefghijklmnop123&accountId=321&webhookCampaignId=456' -d {}

Sample Data Response:

{
    "Status": 204,
    "Message": null
}