Get Profiles stats with API

Overview:

You can use the REST API to access some zopto resources.


Authentification

In the headers section of the request set the value Token: {value} Where the {value} is the API key from the page: https://zopto.com/cloud/a/settings

Get users of the agency

Url: “https://zopto.com/v1/zapi/users"
Method: GET
If success, return:

{
success: true,
users: [
{
company: "company",
created_at: 1541494075558,
email: "email",
first_name: first_name,
last_name: last_name
},
{
...
}
]
}

Get campaigns for a user

Url: “https://zopto.com/v1/zapi/{email}/campaigns"
Where {email} is the email of user;
Method: GET
If success, return:
{
success: true,
campaigns: [
{
campaign_id: 1541494075558,
created_at: 1541494075558,
inmails_enable: true,
invites_enable: true,
name: "Campaign name",
searchUrls: {https://www.linkedin.com/sales/se...”},
sequence_enable: false,
status: "pause",
twitter_enable: true,
user_email: "john_doe@email.com"
views_enable: true
},
{
...
}
]
}

Get stats for a user:


Url: “https://zopto.com/v1/zapi/{email}/stats?campaign_id=1541494075558&startDate=2019-10-18&endDate=2019-12-19"
Where
{email} is the email of user;
campaign_id = the campaign_id for a campaign or no campaign for all campaigns
startDate = the start date of the series,
endDate = the end date of the series
Method: GET
If success, return:
{
success: true,
series: [{
accepted: {2019-11-19: 0, 2019-11-20: 0, 2019-11-21: 0, 2019-11-22: 0, 2019-11-23: 0, …}
inmails: {2019-11-19: 0, 2019-11-20: 0, 2019-11-21: 0, 2019-11-22: 0, 2019-11-23: 0, …}
invites: {2019-11-19: 0, 2019-11-20: 0, 2019-11-21: 0, 2019-11-22: 0, 2019-11-23: 0, …}
replies: {2019-11-19: 0, 2019-11-20: 0, 2019-11-21: 0, 2019-11-22: 0, 2019-11-23: 0, …}
sequences: {2019-11-19: 0, 2019-11-20: 0, 2019-11-21: 0, 2019-11-22: 0, 2019-11-23: 0, …}
twitters: {2019-11-19: 0, 2019-11-20: 0, 2019-11-21: 0, 2019-11-22: 0, 2019-11-23: 0, …}
views: {2019-11-19: 0, 2019-11-20: 0, 2019-11-21: 0, 2019-11-22: 0, 2019-11-23: 0, …}
}],
totals: {
accepted: 333,
inmails: 124,
invites: 54,
replies: 41,
reply_inmail: 13,
reply_invite: 11,
reply_other: 14,
twitters: 25,
views: 14
}
}

Add profiles to a user campaign

Add profile - Url “https://zopto.com/v1/z-api/{email}/add_profile_to_campaign"
Data:
{
"profile_url": {profile_url}", // or "profile_public_id": {profile_public_id}",
"campaign_id": {campaign_id},
"custom_field_1": {custom_field_1},
"custom_field_2": {custom_field_2},
"custom_field_3": {custom_field_3}
}

Where:
{email} is the email of user;
{profile_url} = is the url of the linkedin profile (from Linkedin Premium and Sales Navigator)
{profile_public_id} = the id of profile (rctracted from url)
{campaign_id} = the id of the campaign where the profile will be added
{custom_field_X} = custom fields for the campaign above (optional)

Method: PUT

If success, the api return:
{
"username": "john.doe@email.com", // the email of zopto user
"request_id": "a5d402e8-apirqa-aa59-154c-8f4a0e764e28", // request id
"time": 1600166774673,
"status": "SUCCESS", // or FAIL or PENDING
"request_event": {
"profile_public_id": "billGates",
"campaign_id": 1588564325615,
"custom_field_1": "Custom field 1",
"custom_field_2": "Custom field 2",
"custom_field_3": "Custom field 3"
},
"request_date": "2020-07-10 10:46:14",
"response_date": "2020-07-10 10:46:14",
"response": {
"profile": {
"profile_id": 124353535, //the profile id
"profile_first_name": "Joshua",
"profile_last_name": "Pal",
"profile_linkedin_url": "https://www.linkedin.com/in/joshuapal",
"profile_title": "Manager ",
"company_name": "IBM",
"distance": 2
},
"action": "new_profile" // new_profile or update_profile
}
}

Get profiles for a user:

Get one profile - Url “https://zopto.com/v1/zapi/{email}/profiles?profile_id={profile_id}"
Get all profiles - Url “https://zopto.com/v1/zapi/{email}/profiles"
Get next profiles - Url “https://zopto.com/v1/zapi/{email}/profiles?next={next}"
Where
{email} is the email of user;
{profile_id} = the id of profile (in numeric format)
{next} = next profile
{campaign_id} Get profiles only from this campaign
More options:
connectedAt_after={connectedAt_after} Get profiles only connected after date (format: 2020-09-20)
connectedAt before={connectedAt_before} Get profiles only connected before date (format: 2020-09-20)
connectedAt between two dates= {connectedAt_before} & {connectedAt_before} Get profiles only connected between dates: {connectedAt_before} and {connectedAt_before} (format: 2020-09-20)
distance={distance} Get profiles only with specific distance ( 1, 2 or 3 )
label={label} Get profiles only with specific label
replied={replied} Get only profiles who replied (ex. replied=true)
skipped_profiles={skipped_profiles} Get only skipped profiles (ex. skipped=true)
has_twitter={has_twitter} Get only profiles with twitter (ex. twitter=true)

Method: GET

If success, return:
{
success: true,
"profiles": [
{
"profile_id": 1234,
"profile_first_name": "John",
"profile_last_name": "Doe",
"profile_location": null,
"profile_linkedin_url": "https://www.linkedin.com/in/johnDoe",
"profile_title": null,
"invite_status": false,
"skip_profile": false,
"company_name": "Comp",
"company_website": "comp.com",
"company_industry": "industry",
"company_location": null,
"company_employeeCount": 100,
"twitter": null,
"distance": 1,
"connectedAt": null,
"connectedAt_date": null,
"invitation_withdrawnAt": null,
"invitation_withdrawnAt_date": null,
"invited_at_date": null,
"viewed_at_date": null,
"campaign_id": "1550137469718",
"campaign_name": "Campaign",
"p_view": false,
"p_twitter": false,
"p_invite": true,
"p_invite_fail": false,
"p_inmail": false,
"p_inmail_fail": false,
"p_sequence0": false,
"p_sequence1": false,
"p_sequence2": false,
"p_sequence3": false,
"p_sequence4": false,
"p_sequence0_fail": false,
"p_sequence1_fail": false,
"p_sequence2_fail": false,
"p_sequence3_fail": false,
"p_sequence4_fail": false
//new
scheduled_date: "2020-10-25"
"responded_at_module": "sequence0",

},
{
...
}
],
"profiles_length": 1,
"next": null
}

Add user to an agency:

Url: "https://zopto.com/v1/zapi/add_user"
Method: PUT
Data:
{
"email": "john_doe@gmail.com", //Email of the new user
"password": "password",
"enabled": true, //if user is enabled
"first_name": "John",
"last_name": "Doe",
"company": "Company name",
"permission_admin": true, //Provide Super Admin privileges (full access to Agency dashboard)
"permission_campaigns": true, //Provide access to campaigns menu
"permission_connections": true, //Allow to view/connect linkedin and twitter accounts and My profile
"permission_inbox": true, //Provide access to inbox menu
"permission_settings": true, //Provide access to settings menu
"permission_support": true, //Provide access to support menu
"permission_templates": true //Provide access to templates menu
}

If success, return:

{
success: true,
"user_added": "john_doe@gmail.com",
}


Examples (JavaScript):

Get users

$.ajax({
"url": "https://zopto.com/v1/zapi/users",
"method": "GET",
"headers": {
"Token": "3c322d1f-7R7-d8-6fe-9c2b764869"
}
})
.done(function(err, response) {console.log("Result: ", err, response);})
.error( function(err) {console.log("Error: ", err);})
Get user
$.ajax({
"url": "https://zopto.com/v1/zapi/users?email=john_doe@email.com",
"method": "GET",
"headers": {
"Token": "3c322d1f-7R7-d8-6fe-9c2b764869"
}
})
.done(function(err, response) {console.log("Result: ", err, response);})
.error( function(err) {console.log("Error: ", err);})
Get campaigns
$.ajax({
"url": "https://zopto.com/v1/zapi/john_doe@email.com/campaigns",
"method": "GET",
"headers": {
"Token": "3c322d1f-7R7-d8-6fe-9c2b764869"
}
})
.done(function(err, response) {console.log("Result: ", err, response);})
.error( function(err) {console.log("Error: ", err);})
Get stats
$.ajax({
"url": "https://zopto.com/v1/zapi/john_doe@email.com/stats?campaign_id=&startDate=2019-10-01&endDate=2019-12-15",
"method": "GET",
"headers": {
"Token": "3c322d1f-7R7-d8-6fe-9c2b764869"
}
})
.done(function(err, response) {console.log("Result: ", err, response);})
.error( function(err) {console.log("Error: ", err);})
Get one profile
$.ajax({
"url": "https://zopto.com/v1/zapi/john_doe@email.com/profiles?profile_id=12345",
"method": "GET",
"headers": {
"Token": "3c322d1f-7R7-d8-6fe-9c2b764869"
}
})
.done(function(err, response) {console.log("Result: ", err, response);})
.error( function(err) {console.log("Error: ", err);})
Get all profiles
$.ajax({
"url": "https://zopto.com/v1/zapi/john_doe@email.com/profiles?campaign_id=&connectedAt_after=2020-01-27&replied=true≠xt=null", //for next profiles: ?next=12345
"method": "GET",
"headers": {
"Token": "3c322d1f-7R7-d8-6fe-9c2b764869"
}
})
.done(function(err, response) {console.log("Result: ", err, response);})
.error( function(err) {console.log("Error: ", err);})
Get all profiles connected between the dates: 2020-05-27 and 2020-10-27
$.ajax({
"url": "https://zopto.com/v1/zapi/john_doe@email.com/profiles?campaign_id=&connectedAt_after=2020-05-27&connectedAt_before=2020-20-27≠xt=null", //for next profiles: ?next=12345
"method": "GET",
"headers": {
"Token": "3c322d1f-7R7-d8-6fe-9c2b764869"
}
})
.done(function(err, response) {console.log("Result: ", err, response);})
.error( function(err) {console.log("Error: ", err);})
Add profile to a user campaign
$.ajax({
"url": "https://zopto.com/v1/zapi/john_doe@email.com/add_profile_to_campaign", //for next profiles: ?next=12345
"method": "PUT",
"headers": {
"Token": "3c322d1f-7R7-d8-6fe-9c2b764869"
},
data: {
{
"profile_url": "https://www.linkedin.com/in/williamhgates/", // or: "profile_public_id": "williamhgates",
"campaign_id": 1588164324614,
"custom_field_1": "Custom field 1",
"custom_field_2": "Custom field 2",
"custom_field_3": "Custom field 3"
}
}
})
.done(function(err, response) {console.log("Result: ", err, response);})
.error( function(err) {console.log("Error: ", err);})

Add user to an agency

$.ajax({
"url": "https://zopto.com/v1/zapi/add_user",
"method": "PUT",
"headers": {
"Token": "3c322d1f-7R7-d8-6fe-9c2b764869"
},
data: {
{
"email": "john_doe@gmail.com",
"password": "password",
"enabled": true,
"first_name": "John",
"last_name": "Doe",
"company": "Company name",
"permission_admin": true,
"permission_campaigns": true,
"permission_connections": true,
"permission_inbox": true,
"permission_settings": true,
"permission_support": true,
"permission_templates": true
}
}
})
.done(function(err, response) {console.log("Result: ", err, response);})
.error( function(err) {console.log("Error: ", err);})
Did this answer your question?