Introduction
Welcome to the Wingmate API Documentation page. Our API allows for reading from and writing to the Wingmate data model.
You can read a description of the various API endpoints on the left and view code examples in the dark area to the right.
Authentication
To authorize, use this code:
curl "https://fly.wingmateapp.com/api/v1.0/"
-X GET
-H "Authorization: Bearer YourWingmateAPIKey"
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
}
body = None
conn.request("GET", "/v1.0/", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/",
{
method: 'GET',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
},
}
);
return await response.json();
Make sure to replace
YourWingmateAPIkey
with your API key.
Wingmate uses API keys to allow access to our API. Company administrators have access to an API key that works on behalf of all users, for all of the campaigns managed within the company account.
Wingmate expects for the API key to be included in all API requests to the server in a header that looks like the following:
Authorization: Bearer YourWingmateAPIkey
Actions Attributed to a User
Some API calls are actions being taken on behalf of a user. For example, when a lead status is updated, Wingmate must attribute the update to a user. In order to achieve this attribution via our API, please also supply the following header:
X-User-Id: WingmateUserID
Schema
Supported time zones
Use the command below to change a users' time zone
curl "https://fly.wingmateapp.com/api/v1.0/leads/:lead_id"
-X PUT
-H "Authorization: Bearer YourWingmateAPIKey"
--data '{"user":{"time_zone":"Eastern Time (US & Canada)"}}'
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/leads/:lead_id')
req = Net::HTTP::Put.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
request.body = '{"user":{"time_zone":"Eastern Time (US & Canada)"}}';
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
}
body = {"user":{"time_zone":"Eastern Time (US & Canada)"}}
conn.request("PUT", "/v1.0/leads/:lead_id", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/leads/:lead_id",
{
method: 'PUT',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
},
body: {"user":{"time_zone":"Eastern Time (US & Canada)"}}
}
);
return await response.json();
Wingmate supports the following time zone settings for users on your campaign. Set the users' timezone by assigning it to the Time zone value
in the table below:
Time zone value | Offset to GMT |
---|---|
Abu Dhabi | GMT+04:00 |
Adelaide | GMT+09:30 |
Alaska | GMT-09:00 |
Almaty | GMT+06:00 |
American Samoa | GMT-11:00 |
Amsterdam | GMT+01:00 |
Arizona | GMT-07:00 |
Astana | GMT+06:00 |
Athens | GMT+02:00 |
Atlantic Time (Canada) | GMT-04:00 |
Auckland | GMT+12:00 |
Azores | GMT-01:00 |
Baghdad | GMT+03:00 |
Baku | GMT+04:00 |
Bangkok | GMT+07:00 |
Beijing | GMT+08:00 |
Belgrade | GMT+01:00 |
Berlin | GMT+01:00 |
Bern | GMT+01:00 |
Bogota | GMT-05:00 |
Brasilia | GMT-03:00 |
Bratislava | GMT+01:00 |
Brisbane | GMT+10:00 |
Brussels | GMT+01:00 |
Bucharest | GMT+02:00 |
Budapest | GMT+01:00 |
Buenos Aires | GMT-03:00 |
Cairo | GMT+02:00 |
Canberra | GMT+10:00 |
Cape Verde Is. | GMT-01:00 |
Caracas | GMT-04:00 |
Casablanca | GMT+00:00 |
Central America | GMT-06:00 |
Central Time (US & Canada) | GMT-06:00 |
Chatham Is. | GMT+12:45 |
Chennai | GMT+05:30 |
Chihuahua | GMT-07:00 |
Chongqing | GMT+08:00 |
Copenhagen | GMT+01:00 |
Darwin | GMT+09:30 |
Dhaka | GMT+06:00 |
Dublin | GMT+00:00 |
Eastern Time (US & Canada) | GMT-05:00 |
Edinburgh | GMT+00:00 |
Ekaterinburg | GMT+05:00 |
Fiji | GMT+12:00 |
Georgetown | GMT-04:00 |
Greenland | GMT-03:00 |
Guadalajara | GMT-06:00 |
Guam | GMT+10:00 |
Hanoi | GMT+07:00 |
Harare | GMT+02:00 |
Hawaii | GMT-10:00 |
Helsinki | GMT+02:00 |
Hobart | GMT+10:00 |
Hong Kong | GMT+08:00 |
Indiana (East) | GMT-05:00 |
International Date Line West | GMT-12:00 |
Irkutsk | GMT+08:00 |
Islamabad | GMT+05:00 |
Istanbul | GMT+03:00 |
Jakarta | GMT+07:00 |
Jerusalem | GMT+02:00 |
Kabul | GMT+04:30 |
Kaliningrad | GMT+02:00 |
Kamchatka | GMT+12:00 |
Karachi | GMT+05:00 |
Kathmandu | GMT+05:45 |
Kolkata | GMT+05:30 |
Krasnoyarsk | GMT+07:00 |
Kuala Lumpur | GMT+08:00 |
Kuwait | GMT+03:00 |
Kyiv | GMT+02:00 |
La Paz | GMT-04:00 |
Lima | GMT-05:00 |
Lisbon | GMT+00:00 |
Ljubljana | GMT+01:00 |
London | GMT+00:00 |
Madrid | GMT+01:00 |
Magadan | GMT+11:00 |
Marshall Is. | GMT+12:00 |
Mazatlan | GMT-07:00 |
Melbourne | GMT+10:00 |
Mexico City | GMT-06:00 |
Mid-Atlantic | GMT-02:00 |
Midway Island | GMT-11:00 |
Minsk | GMT+03:00 |
Monrovia | GMT+00:00 |
Monterrey | GMT-06:00 |
Montevideo | GMT-03:00 |
Moscow | GMT+03:00 |
Mountain Time (US & Canada) | GMT-07:00 |
Mumbai | GMT+05:30 |
Muscat | GMT+04:00 |
Nairobi | GMT+03:00 |
New Caledonia | GMT+11:00 |
New Delhi | GMT+05:30 |
Newfoundland | GMT-03:30 |
Novosibirsk | GMT+07:00 |
Nuku'alofa | GMT+13:00 |
Osaka | GMT+09:00 |
Pacific Time (US & Canada) | GMT-08:00 |
Paris | GMT+01:00 |
Perth | GMT+08:00 |
Port Moresby | GMT+10:00 |
Prague | GMT+01:00 |
Pretoria | GMT+02:00 |
Puerto Rico | GMT-04:00 |
Quito | GMT-05:00 |
Rangoon | GMT+06:30 |
Riga | GMT+02:00 |
Riyadh | GMT+03:00 |
Rome | GMT+01:00 |
Samara | GMT+04:00 |
Samoa | GMT+13:00 |
Santiago | GMT-04:00 |
Sapporo | GMT+09:00 |
Sarajevo | GMT+01:00 |
Saskatchewan | GMT-06:00 |
Seoul | GMT+09:00 |
Singapore | GMT+08:00 |
Skopje | GMT+01:00 |
Sofia | GMT+02:00 |
Solomon Is. | GMT+11:00 |
Srednekolymsk | GMT+11:00 |
Sri Jayawardenepura | GMT+05:30 |
St. Petersburg | GMT+03:00 |
Stockholm | GMT+01:00 |
Sydney | GMT+10:00 |
Taipei | GMT+08:00 |
Tallinn | GMT+02:00 |
Tashkent | GMT+05:00 |
Tbilisi | GMT+04:00 |
Tehran | GMT+03:30 |
Tijuana | GMT-08:00 |
Tokelau Is. | GMT+13:00 |
Tokyo | GMT+09:00 |
UTC | GMT+00:00 |
Ulaanbaatar | GMT+08:00 |
Urumqi | GMT+06:00 |
Vienna | GMT+01:00 |
Vilnius | GMT+02:00 |
Vladivostok | GMT+10:00 |
Volgograd | GMT+04:00 |
Warsaw | GMT+01:00 |
Wellington | GMT+12:00 |
West Central Africa | GMT+01:00 |
Yakutsk | GMT+09:00 |
Yerevan | GMT+04:00 |
Zagreb | GMT+01:00 |
Zurich | GMT+01:00 |
Objects
Coming soon!
API
Get API Information
curl "https://fly.wingmateapp.com/api/v1.0/"
-X GET
-H "Authorization: Bearer YourWingmateAPIKey"
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
}
body = None
conn.request("GET", "/v1.0/", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/",
{
method: 'GET',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
},
}
);
return await response.json();
The above command returns JSON structured like this:
{
"api": {
"version": "1.0",
"tag": "1.7.10"
}
}
Returns the current API version and Wingmate app release version.
HTTP Request
GET https://fly.wingmateapp.com/api/v1.0
User Sessions
Sign in a User
curl "https://fly.wingmateapp.com/api/v1.0/users/sign_in"
-X POST
-H "Authorization: Bearer YourWingmateAPIKey"
--data '{"user":{"password":"password","email":"example@email.com"}}'
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/users/sign_in')
req = Net::HTTP::Post.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
request.body = '{"user":{"password":"password","email":"example@email.com"}}';
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
}
body = {"user":{"password":"password","email":"example@email.com"}}
conn.request("POST", "/v1.0/users/sign_in", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/users/sign_in",
{
method: 'POST',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
},
body: {"user":{"password":"password","email":"example@email.com"}}
}
);
return await response.json();
The above command returns JSON structured like this:
{
"user": {
"id": 482,
"email": "aiden@wingmate.com",
"full_name": "Aiden Carnegie",
"type": "Manager",
"uuid": "1234567890",
"profile_image_url": "",
"receive_emails": true,
"campaigns": [
1
],
"leads_to_next_level": {
"number": "-",
"string": "Capture leads to see results"
},
"level": "white"
}
}
Signs in the user on the campaign and returns an auth_token to be used for user level authentication to the platform
HTTP Request
POST https://fly.wingmateapp.com/api/v1.0/users/sign_in
Query Parameters
Parameter | Description | Param Type |
---|---|---|
user:email | The email of the user to sign in. | String |
user:password | The password of the user. | String |
Sign out a User
curl "https://fly.wingmateapp.com/api/v1.0/users/sign_out"
-X DELETE
-H "Authorization: Bearer YourWingmateAPIKey"
-H "auth_token: usersAuthToken"
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/users/sign_out')
req = Net::HTTP::Delete.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
req['auth_token'] = "usersAuthToken"
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
"auth_token": "usersAuthToken"
}
body = None
conn.request("DELETE", "/v1.0/users/sign_out", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/users/sign_out",
{
method: 'DELETE',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
'auth_token': 'usersAuthToken'
},
}
);
return await response.json();
The above command will return a status of 200 if it was succesful
Signs out a user, clearing the auth_token of a user.
HTTP Request
DELETE https://fly.wingmateapp.com/api/v1.0/users/sign_out
Campaigns
Get a Campaign
curl "https://fly.wingmateapp.com/api/v1.0/campaigns/:campaign_id"
-X GET
-H "Authorization: Bearer YourWingmateAPIKey"
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/campaigns/:campaign_id')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
}
body = None
conn.request("GET", "/v1.0/campaigns/:campaign_id", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/campaigns/:campaign_id",
{
method: 'GET',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
},
}
);
return await response.json();
The above command returns JSON structured like this:
{
"campaign": {
"id": 1,
"name": "Example Campaign",
"gold_lead_target": 1,
"gold_multiplier": "2.0",
"logo_url": "",
"lead_image_settings": "optional",
"safety_config": {
"speed_limit_in_km_hr": "15",
"safety_action": "WARN"
},
"custom_fields": [
{
"id": "text_field",
"name": "Text Field Example",
"type": "text",
"required": true,
"platform": "both"
},
{
"id": "choice_field",
"name": "Choose One",
"type": "select",
"platform": "web",
"options": [
"one",
"two",
"three"
],
"required": false
},
{
"id": "select_field",
"name": "Select Many",
"type": "select",
"required": true,
"platform": "both",
"options": [
"Selection 1",
"Selection 2"
],
"default": "Selection 1"
},
{
"id": "webonly",
"name": "Second Web only",
"type": "text",
"platform": "web",
"required": false
}
],
"created_at": "2015-05-11T18:06:51Z",
"sales_cycle": [
{
"id": "fresh",
"label": "New"
},
{
"id": "received_by_sales",
"label": "Received"
},
{
"id": "work_in_progress",
"label": "Working"
},
{
"id": "pending_decision",
"label": "Proposal Sent"
},
{
"id": "contract_signed",
"label": "Completed"
},
{
"id": "completed",
"label": "Success"
},
{
"id": "failed",
"label": "Failed"
},
{
"id": "hibernated",
"label": "Archived"
}
]
}
}
This endpoint returns the information and settings for your campaign in Wingmate.
HTTP Request
GET https://fly.wingmateapp.com/api/v1.0/campaigns/:campaign_id
Query Parameters
Parameter | Description | Param Type |
---|---|---|
campaign_id | The ID of your campaign. | Integer |
Update a Campaign
curl "https://fly.wingmateapp.com/api/v1.0/campaigns/:campaign_id"
-X PUT
-H "Authorization: Bearer YourWingmateAPIKey"
--data '{"campaign":{"name":"Wingmate"}}'
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/campaigns/:campaign_id')
req = Net::HTTP::Put.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
request.body = '{"campaign":{"name":"Wingmate"}}';
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
}
body = {"campaign":{"name":"Wingmate"}}
conn.request("PUT", "/v1.0/campaigns/:campaign_id", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/campaigns/:campaign_id",
{
method: 'PUT',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
},
body: {"campaign":{"name":"Wingmate"}}
}
);
return await response.json();
The above command will return a status of 200 if the update was successful
This endpoint allows you to change your campaign information and settings.
HTTP Request
PUT https://fly.wingmateapp.com/api/v1.0/campaigns/:campaign_id
Query Parameters
Parameter | Description | Param Type |
---|---|---|
campaign_id | The ID of your campaign. | Integer |
campaign:name | The name of the campaign. | String |
campaign:shipping_address | The address associated with your campaign to send swag. | String |
campaign:logo_url | The logo presented in the header of the Wingmate CRM | String |
campaign:billing_email | The email we will send your campaign's bills to | String |
Get all Users on a Campaign
curl "https://fly.wingmateapp.com/api/v1.0/campaigns/:campaign_id/users"
-X GET
-H "Authorization: Bearer YourWingmateAPIKey"
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/campaigns/:campaign_id/users')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
}
body = None
conn.request("GET", "/v1.0/campaigns/:campaign_id/users", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/campaigns/:campaign_id/users",
{
method: 'GET',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
},
}
);
return await response.json();
The above command returns JSON structued like this:
{
"users": [{
"id": 482,
"email": "aiden@wingmate.com",
"full_name": "Aiden Carnegie",
"type": "Manager",
"uuid": "1234567890",
"profile_image_url": "",
"receive_emails": true,
"campaigns": [
1
],
"leads_to_next_level": {
"number": "-",
"string": "Capture leads to see results"
},
"level": "white"
}]
}
Returns all users that are a part of your campaign.
HTTP Request
GET https://fly.wingmateapp.com/api/v1.0/campaigns/:campaign_id/users
Query Parameters
Parameter | Description | Param Type |
---|---|---|
campaign_id | The ID of your campaign. | Integer |
page | The page number for the user query. | Integer |
order | Sorts the users returned by this API call. | OneOf("id", "full_name") |
type[] | Filters the list of returned users by one or more user types. | AnyOf("Worker", "Manager", "Salesperson", "CompanyAdmin") |
Create a User on a Campaign
curl "https://fly.wingmateapp.com/api/v1.0/campaigns/:campaign_id/users"
-X POST
-H "Authorization: Bearer YourWingmateAPIKey"
--data '{"user":{"password":"password","email":"aiden@wingmate.com","full_name":"Aiden Carnegie","phone_number":"1234567890","uuid":"1234567890"}}'
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/campaigns/:campaign_id/users')
req = Net::HTTP::Post.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
request.body = '{"user":{"password":"password","email":"aiden@wingmate.com","full_name":"Aiden Carnegie","phone_number":"1234567890","uuid":"1234567890"}}';
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
}
body = {"user":{"password":"password","email":"aiden@wingmate.com","full_name":"Aiden Carnegie","phone_number":"1234567890","uuid":"1234567890"}}
conn.request("POST", "/v1.0/campaigns/:campaign_id/users", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/campaigns/:campaign_id/users",
{
method: 'POST',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
},
body: {"user":{"password":"password","email":"aiden@wingmate.com","full_name":"Aiden Carnegie","phone_number":"1234567890","uuid":"1234567890"}}
}
);
return await response.json();
The above command returns JSON structured like this:
{
"user": {
"id": 482,
"email": "aiden@wingmate.com",
"full_name": "Aiden Carnegie",
"type": "Manager",
"uuid": "1234567890",
"profile_image_url": "",
"receive_emails": true,
"campaigns": [
1
],
"leads_to_next_level": {
"number": "-",
"string": "Capture leads to see results"
},
"level": "white"
}
}
Creates a user with the given parameters
HTTP Request
POST https://fly.wingmateapp.com/api/v1.0/campaigns/:campaign_id/users
Parameter | Description | Param Type | Required? |
---|---|---|---|
campaign_id | The ID of your campaign. | Integer | Required |
users:email | The email of the user | String | Required |
users:full_name | The name of the user | String | Required |
users:password | The password of the user (auto-generated if left blank) | String | Optional |
users:phone_number | The phone number of the user | String | Required |
users:profile_image_url | A URL pointing to the users profile image | String | Optional |
users:receives_sms | A flag so that they receive SMS for your campaign (default is True) | Boolean | Optional |
users:tag | A tag that other uses can use to mention users in comments (this is automatically generated if left blank) | String | Optional |
users:time_zone | The time zone for the users' location (See available time zones) | String | Optional |
users:type | The type of user you wish to create | OneOf(Manager, Salesperson, Worker) | Required |
users:uuid | A unique identifier the user can use to log in with (generated from the phone number if left blank) | Integer | Optional |
Get a Campaign's Good Lead page
curl "https://fly.wingmateapp.com/api/v1.0/campaigns/:campaign_id/good_lead"
-X GET
-H "Authorization: Bearer YourWingmateAPIKey"
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/campaigns/:campaign_id/good_lead')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
}
body = None
conn.request("GET", "/v1.0/campaigns/:campaign_id/good_lead", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/campaigns/:campaign_id/good_lead",
{
method: 'GET',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
},
}
);
return await response.json();
The above command returns the HTML to be rendered
This endpoint will return the HTML rendered from your campaign's Good Lead
page. The Good Lead
page is an in-app web view that shows your Frontline Members what information makes a good lead.
HTTP Request
GET https://fly.wingmateapp.com/api/v1.0/campaigns/:campaign_id/good_lead
Query Parameters
Parameter | Description | Param Type |
---|---|---|
campaign_id | The ID of your campaign. | Integer |
Get all Leads on a Campaign
curl "https://fly.wingmateapp.com/api/v1.0/campaigns/:campaign_id/leads"
-X GET
-H "Authorization: Bearer YourWingmateAPIKey"
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/campaigns/:campaign_id/leads')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
}
body = None
conn.request("GET", "/v1.0/campaigns/:campaign_id/leads", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/campaigns/:campaign_id/leads",
{
method: 'GET',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
},
}
);
return await response.json();
The above command returns JSON structured like this:
{
"leads": [
{
"id": 1092443,
"campaign_id": 23492,
"description": "New Business Lead - Check it out",
"latitude": 123.456789,
"longitude": -123.456789,
"status": "work_in_progress",
"address": "1234 Example St, Toronto",
"photo_urls": [
"https://wingmatepro.com/lead_109.jpg"
],
"recording_url": null,
"thumbnail_url": "https://wingmatepro.com/lead_109_thumbnail.jpg",
"status_string": "In Progress",
"status_bar_colour": "#214300",
"created_at": "2015-12-11T22:55:17Z",
"updated_at": "2016-05-18T17:41:26Z",
"actions": [
{
"id": 120,
"text": "Action Required: Need more images",
"created_at": "2016-04-22T15:00:30Z",
"salesperson": {
"id": 3,
"full_name": "Steven Sales",
"type": "Salesperson"
},
"fulfilling_comment": null
}
],
"comments": [
{
"id": 237,
"text": "Lead Comment.",
"recording_url": null,
"photo_urls": [],
"created_at": "2016-01-26T19:04:39Z",
"user": {
"id": 2,
"full_name": "Ben S",
"type": "Salesperson"
},
"fulfilled_action": null
}
],
"reminders": [],
"status_updates": [
{
"status": "work_in_progress",
"previous_status": "received_by_sales",
"status_string": "Working...",
"previous_status_string": "Received",
"created_at": "2016-01-22T05:42:18Z",
"user": {
"id": 2,
"full_name": "Ben S",
"type": "Salesperson"
},
"comment_string": "Ben S has set status to 'Working...'."
}
],
"worker": {
"full_name": "William Worker",
"id": 5550,
"type": "Worker"
},
"salesperson": {
"full_name": "Sally Salesperson",
"id": 5551,
"type": "Salesperson"
},
}
]
}
Gets all of a campaigns leads.
HTTP Request
GET https://fly.wingmateapp.com/api/v1.0/campaigns/:campaign_id/leads
Query Parameters
Parameter | Description | Param Type |
---|---|---|
campaign_id | The ID of your campaign | Integer |
page | The page number for the lead query | Integer |
Create a Lead on a Campaign
curl "https://fly.wingmateapp.com/api/v1.0/campaigns/:campaign_id/leads"
-X POST
-H "Authorization: Bearer YourWingmateAPIKey"
--data '{"lead":{"description":"A lead description goes here","worker_id":1,"salesperson_id":2,"latitude":43.668830658,"longitude":-79.385331792}}'
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/campaigns/:campaign_id/leads')
req = Net::HTTP::Post.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
request.body = '{"lead":{"description":"A lead description goes here","worker_id":1,"salesperson_id":2,"latitude":43.668830658,"longitude":-79.385331792}}';
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
}
body = {"lead":{"description":"A lead description goes here","worker_id":1,"salesperson_id":2,"latitude":43.668830658,"longitude":-79.385331792}}
conn.request("POST", "/v1.0/campaigns/:campaign_id/leads", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/campaigns/:campaign_id/leads",
{
method: 'POST',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
},
body: {"lead":{"description":"A lead description goes here","worker_id":1,"salesperson_id":2,"latitude":43.668830658,"longitude":-79.385331792}}
}
);
return await response.json();
The above command returns JSON structured like this:
{
"lead": {
"id": 1092443,
"campaign_id": 23492,
"description": "New Business Lead - Check it out",
"latitude": 123.456789,
"longitude": -123.456789,
"status": "work_in_progress",
"address": "1234 Example St, Toronto",
"photo_urls": [
"https://wingmatepro.com/lead_109.jpg"
],
"recording_url": null,
"thumbnail_url": "https://wingmatepro.com/lead_109_thumbnail.jpg",
"status_string": "In Progress",
"status_bar_colour": "#214300",
"created_at": "2015-12-11T22:55:17Z",
"updated_at": "2016-05-18T17:41:26Z",
"actions": [
{
"id": 120,
"text": "Action Required: Need more images",
"created_at": "2016-04-22T15:00:30Z",
"salesperson": {
"id": 3,
"full_name": "Steven Sales",
"type": "Salesperson"
},
"fulfilling_comment": null
}
],
"comments": [
{
"id": 237,
"text": "Lead Comment.",
"recording_url": null,
"photo_urls": [],
"created_at": "2016-01-26T19:04:39Z",
"user": {
"id": 2,
"full_name": "Ben S",
"type": "Salesperson"
},
"fulfilled_action": null
}
],
"reminders": [],
"status_updates": [
{
"status": "work_in_progress",
"previous_status": "received_by_sales",
"status_string": "Working...",
"previous_status_string": "Received",
"created_at": "2016-01-22T05:42:18Z",
"user": {
"id": 2,
"full_name": "Ben S",
"type": "Salesperson"
},
"comment_string": "Ben S has set status to 'Working...'."
}
],
"worker": {
"full_name": "William Worker",
"id": 5550,
"type": "Worker"
},
"salesperson": {
"full_name": "Sally Salesperson",
"id": 5551,
"type": "Salesperson"
},
}
}
Create a lead on your campaign
HTTP Request
POST https://fly.wingmateapp.com/api/v1.0/campaigns/:campaign_id/leads
Query Parameters
Parameter | Description | Param Type | Required? |
---|---|---|---|
campaign_id | The ID of your campaign | Integer | Required |
leads:worker_id | The ID of the user who generated the lead | Integer | Required |
leads:salesperson_id | The ID of the salesperson assigned to the lead | Integer | Optional |
leads:description | A text description for the lead | String | Required if no recording_url or photo_urls present |
leads:address | The address of the lead (auto-generated if latitude/longitude are specified) | String | Optional |
leads:latitude | The latitude coordinate for the lead's location | Decimal | Optional |
leads:longitude | The longitude coordinate for the lead's location | Decimal | Optional |
leads:recording_url | A url to a mp3 file for a recorded description | String | Required if no description or photo_urls present |
leads:photo_urls | An array of urls set associated with the lead | String | Required if no description or recording_url present |
leads:custom_fields | A hash of values for your campaigns custom fields for leads | hash | Possibly required |
leads:status | The current status of the lead in the Wingmate CRM Pipeline | OneOf("fresh", "received_by_sales", "work_in_progress", "pending_decision", "contract_signed", "completed", "failed", "hibernated") | Optional |
lead:amount | Estimated value of the lead | Decimal | Optional |
Users
Get a User
curl "https://fly.wingmateapp.com/api/v1.0/users/:user_id"
-X GET
-H "Authorization: Bearer YourWingmateAPIKey"
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/users/:user_id')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
}
body = None
conn.request("GET", "/v1.0/users/:user_id", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/users/:user_id",
{
method: 'GET',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
},
}
);
return await response.json();
The above command returns JSON structured like this:
{
"user": {
"id": 482,
"email": "aiden@wingmate.com",
"full_name": "Aiden Carnegie",
"type": "Manager",
"uuid": "1234567890",
"profile_image_url": "",
"receive_emails": true,
"campaigns": [
1
],
"leads_to_next_level": {
"number": "-",
"string": "Capture leads to see results"
},
"level": "white"
}
}
Retrieves the information of a user
HTTP Request
GET https://fly.wingmateapp.com/api/v1.0/users/:user_id
Update a User
curl "https://fly.wingmateapp.com/api/v1.0/users/:user_id"
-X PUT
-H "Authorization: Bearer YourWingmateAPIKey"
--data '{"user":{"full_name":"Aiden Carnegie"}}'
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/users/:user_id')
req = Net::HTTP::Put.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
request.body = '{"user":{"full_name":"Aiden Carnegie"}}';
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
}
body = {"user":{"full_name":"Aiden Carnegie"}}
conn.request("PUT", "/v1.0/users/:user_id", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/users/:user_id",
{
method: 'PUT',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
},
body: {"user":{"full_name":"Aiden Carnegie"}}
}
);
return await response.json();
The above command returns JSON structured like this:
{
"user": {
"id": 482,
"email": "aiden@wingmate.com",
"full_name": "Aiden Carnegie",
"type": "Manager",
"uuid": "1234567890",
"profile_image_url": "",
"receive_emails": true,
"campaigns": [
1
],
"leads_to_next_level": {
"number": "-",
"string": "Capture leads to see results"
},
"level": "white"
}
}
Updates the fields of a user with the request body.
HTTP Request
PUT /v1.0/users/:user_id
Parameter | Description | Param Type |
---|---|---|
user:full_name | The new name for the user | String |
user:password | The new password for the user | String |
user:profile_image_url | A URL to the new profile image for the user | String |
Get a User's Leads
curl "https://fly.wingmateapp.com/api/v1.0/users/:user_id/leads"
-X GET
-H "Authorization: Bearer YourWingmateAPIKey"
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/users/:user_id/leads')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
}
body = None
conn.request("GET", "/v1.0/users/:user_id/leads", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/users/:user_id/leads",
{
method: 'GET',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
},
}
);
return await response.json();
The above command returns JSON structured like this:
{
"leads": [
{
"id": 1092443,
"campaign_id": 23492,
"description": "New Business Lead - Check it out",
"latitude": 123.456789,
"longitude": -123.456789,
"status": "work_in_progress",
"address": "1234 Example St, Toronto",
"photo_urls": [
"https://wingmatepro.com/lead_109.jpg"
],
"recording_url": null,
"thumbnail_url": "https://wingmatepro.com/lead_109_thumbnail.jpg",
"status_string": "In Progress",
"status_bar_colour": "#214300",
"created_at": "2015-12-11T22:55:17Z",
"updated_at": "2016-05-18T17:41:26Z",
"actions": [
{
"id": 120,
"text": "Action Required: Need more images",
"created_at": "2016-04-22T15:00:30Z",
"salesperson": {
"id": 3,
"full_name": "Steven Sales",
"type": "Salesperson"
},
"fulfilling_comment": null
}
],
"comments": [
{
"id": 237,
"text": "Lead Comment.",
"recording_url": null,
"photo_urls": [],
"created_at": "2016-01-26T19:04:39Z",
"user": {
"id": 2,
"full_name": "Ben S",
"type": "Salesperson"
},
"fulfilled_action": null
}
],
"reminders": [],
"status_updates": [
{
"status": "work_in_progress",
"previous_status": "received_by_sales",
"status_string": "Working...",
"previous_status_string": "Received",
"created_at": "2016-01-22T05:42:18Z",
"user": {
"id": 2,
"full_name": "Ben S",
"type": "Salesperson"
},
"comment_string": "Ben S has set status to 'Working...'."
}
],
"worker": {
"full_name": "William Worker",
"id": 5550,
"type": "Worker"
},
"salesperson": {
"full_name": "Sally Salesperson",
"id": 5551,
"type": "Salesperson"
},
}
]
}
For a salesperson: Retrieves all of the leads that a user is assigned to
For a frontline member: Retrieves all of the leads that the user has generated
HTTP Request
GET /v1.0/users/:user_id/leads
Parameter | Description | Param Type |
---|---|---|
user_id | The user who you wish to retrieve their leads list for. | Integer |
page | The page for the lead query | Integer |
updates_from | An optional parameter to retrieve any leads that have been updated after the parameter | Integer (Seconds since Unix epoch) |
Get a User's Requested Actions
curl "https://fly.wingmateapp.com/api/v1.0/users/:user_id/actions"
-X GET
-H "Authorization: Bearer YourWingmateAPIKey"
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/users/:user_id/actions')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
}
body = None
conn.request("GET", "/v1.0/users/:user_id/actions", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/users/:user_id/actions",
{
method: 'GET',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
},
}
);
return await response.json();
The above command returns JSON structured like this:
{
"actions": [{
"id": 166,
"text": "Please talk to them and get a contact number, thanks.",
"lead": {
"id": 804
},
"created_at": "2018-07-20T17:37:47Z",
"user": {
"id": 476,
"full_name": "Martin Manager",
"type": "Manager"
},
"fulfilling_comment": {
"id": 1134
}
}
]
}
Salespeople can request further details regarding a lead from the Frontline Member who has submitted that lead. These requests are known as 'action requests' and are to be fulfilled or replied to by the Frontline Member.
HTTP Request
GET /v1.0/users/:user_id/actions
Parameter | Description | Param Type |
---|---|---|
user_id | The ID of the user you wish to retrieve action requests for | Integer |
page | The page for the action request query | Integer |
Get a User's Campaigns
curl "https://fly.wingmateapp.com/api/v1.0/users/:user_id/campaigns"
-X GET
-H "Authorization: Bearer YourWingmateAPIKey"
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/users/:user_id/campaigns')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
}
body = None
conn.request("GET", "/v1.0/users/:user_id/campaigns", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/users/:user_id/campaigns",
{
method: 'GET',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
},
}
);
return await response.json();
The above command returns JSON structured like this:
{
"campaigns": [{
"id": 1,
"name": "Example Campaign",
"gold_lead_target": 1,
"gold_multiplier": "2.0",
"logo_url": "",
"lead_image_settings": "optional",
"safety_config": {
"speed_limit_in_km_hr": "15",
"safety_action": "WARN"
},
"custom_fields": [
{
"id": "text_field",
"name": "Text Field Example",
"type": "text",
"required": true,
"platform": "both"
},
{
"id": "choice_field",
"name": "Choose One",
"type": "select",
"platform": "web",
"options": [
"one",
"two",
"three"
],
"required": false
},
{
"id": "select_field",
"name": "Select Many",
"type": "select",
"required": true,
"platform": "both",
"options": [
"Selection 1",
"Selection 2"
],
"default": "Selection 1"
},
{
"id": "webonly",
"name": "Second Web only",
"type": "text",
"platform": "web",
"required": false
}
],
"created_at": "2015-05-11T18:06:51Z",
"sales_cycle": [
{
"id": "fresh",
"label": "New"
},
{
"id": "received_by_sales",
"label": "Received"
},
{
"id": "work_in_progress",
"label": "Working"
},
{
"id": "pending_decision",
"label": "Proposal Sent"
},
{
"id": "contract_signed",
"label": "Completed"
},
{
"id": "completed",
"label": "Success"
},
{
"id": "failed",
"label": "Failed"
},
{
"id": "hibernated",
"label": "Archived"
}
]
}
]
}
Retrieves all of the campaigns that a user is a part of.
HTTP Request
GET /v1.0/users/:user_id/campaigns
Get a User's Notifications
curl "https://fly.wingmateapp.com/api/v1.0/users/:user_id/notifications"
-X GET
-H "Authorization: Bearer YourWingmateAPIKey"
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/users/:user_id/notifications')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
}
body = None
conn.request("GET", "/v1.0/users/:user_id/notifications", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/users/:user_id/notifications",
{
method: 'GET',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
},
}
);
return await response.json();
The above command returns JSON structured like this:
{
"notifications": [{
"id": 87,
"text": "Congratulations! You have earned $1000.00 for lead #491 turning into new business!",
"html_item": "<link href='//fonts.googleapis.com/css?family=Roboto:500,400italic,700italic,300,700,500italic,400' rel='stylesheet' type='text/css'><link rel=\\\"stylesheet\\\" href=\\\"//maxcdn.bootstrapcdn.com/font-awesome/4.6.0/css/font-awesome.min.css\\\"><style> body { width: 100%; height: 100%; } h1 { text-align: center; font-family: Roboto; } h4 { } h1, h2, h3, h4, h5, h6 { font-family: Roboto, Helvetica, Arial; font-weight: normal; color: $darkGrey; margin-top: 0; }</style><body> <h1>Congratulations!</h1> <hr> <h4> Congratulations! You have earned $1000.00 for lead #491 turning into new business! </h4></body>",
"created_at": "2019-04-26T14:57:41Z",
"lead": {
"id": 491,
"description": "Potential lead",
"latitude": 123.4567890,
"longitude": -123.4567890,
"status": "completed",
"address": "1 Bloor St West, Toronto, ON",
"photo_urls": [],
"recording_url": null,
"thumbnail_url": "",
"rating_of_worker": 4,
"rating_of_worker_comment": "almost got there!",
"rating_of_sales": 3,
"rating_of_sales_comment": "Fantastic lead!",
"created_at": "2016-05-05T19:35:30Z",
"updated_at": "2019-04-28T16:13:16Z",
"amount": 0.0
},
"viewed": false,
"type": "Notification"
}
]
}
Retrieves all of a users' notifications, sorted by unviewed notifications first and then viewed notifications second.
HTTP Request
GET /v1.0/users/:user_id/notifications
Parameter | Description | Param Type |
---|---|---|
user_id | The ID of the user you wish to their notifications for | Integer |
page | The page for the notification query | Integer |
Create a Notification for a User
curl "https://fly.wingmateapp.com/api/v1.0/users/:user_id"
-X POST
-H "Authorization: Bearer YourWingmateAPIKey"
--data '{"notification":{"text":"Here is a notification","lead_id":2,"html_item":"<div>This is displayed when a user clicks the notification on the mobile platform.</div>"}}'
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/users/:user_id')
req = Net::HTTP::Post.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
request.body = '{"notification":{"text":"Here is a notification","lead_id":2,"html_item":"<div>This is displayed when a user clicks the notification on the mobile platform.</div>"}}';
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
}
body = {"notification":{"text":"Here is a notification","lead_id":2,"html_item":"<div>This is displayed when a user clicks the notification on the mobile platform.</div>"}}
conn.request("POST", "/v1.0/users/:user_id", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/users/:user_id",
{
method: 'POST',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
},
body: {"notification":{"text":"Here is a notification","lead_id":2,"html_item":"<div>This is displayed when a user clicks the notification on the mobile platform.</div>"}}
}
);
return await response.json();
The above command returns JSON structured like this:
{
"notification": {
"id": 87,
"text": "Congratulations! You have earned $1000.00 for lead #491 turning into new business!",
"html_item": "<link href='//fonts.googleapis.com/css?family=Roboto:500,400italic,700italic,300,700,500italic,400' rel='stylesheet' type='text/css'><link rel=\\\"stylesheet\\\" href=\\\"//maxcdn.bootstrapcdn.com/font-awesome/4.6.0/css/font-awesome.min.css\\\"><style> body { width: 100%; height: 100%; } h1 { text-align: center; font-family: Roboto; } h4 { } h1, h2, h3, h4, h5, h6 { font-family: Roboto, Helvetica, Arial; font-weight: normal; color: $darkGrey; margin-top: 0; }</style><body> <h1>Congratulations!</h1> <hr> <h4> Congratulations! You have earned $1000.00 for lead #491 turning into new business! </h4></body>",
"created_at": "2019-04-26T14:57:41Z",
"lead": {
"id": 491,
"description": "Potential lead",
"latitude": 123.4567890,
"longitude": -123.4567890,
"status": "completed",
"address": "1 Bloor St West, Toronto, ON",
"photo_urls": [],
"recording_url": null,
"thumbnail_url": "",
"rating_of_worker": 4,
"rating_of_worker_comment": "almost got there!",
"rating_of_sales": 3,
"rating_of_sales_comment": "Fantastic lead!",
"created_at": "2016-05-05T19:35:30Z",
"updated_at": "2019-04-28T16:13:16Z",
"amount": 0.0
},
"viewed": false,
"type": "Notification"
}
}
HTTP Request
POST /v1.0/users/:user_id/notifications
Parameter | Description | Param Type |
---|---|---|
user_id | The ID of the user the notification is for | Integer |
notification:text | The text of the notification | String |
notification:lead_id | (Optional) An associated lead for the notification | Integer |
notification:html_item | An html string that is rendered in the Wingmate app upon clicking the notifiaction | String |
Leads
Get all leads
curl "https://fly.wingmateapp.com/api/v1.0/leads"
-X GET
-H "Authorization: Bearer YourWingmateAPIKey"
-H "auth_token: usersAuthToken"
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/leads')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
req['auth_token'] = "usersAuthToken"
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
"auth_token": "usersAuthToken"
}
body = None
conn.request("GET", "/v1.0/leads", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/leads",
{
method: 'GET',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
'auth_token': 'usersAuthToken'
},
}
);
return await response.json();
The above command returns JSON structured like this:
{
"leads": [
{
"id": 1092443,
"campaign_id": 23492,
"description": "New Business Lead - Check it out",
"latitude": 123.456789,
"longitude": -123.456789,
"status": "work_in_progress",
"address": "1234 Example St, Toronto",
"photo_urls": [
"https://wingmatepro.com/lead_109.jpg"
],
"recording_url": null,
"thumbnail_url": "https://wingmatepro.com/lead_109_thumbnail.jpg",
"status_string": "In Progress",
"status_bar_colour": "#214300",
"created_at": "2015-12-11T22:55:17Z",
"updated_at": "2016-05-18T17:41:26Z",
"actions": [
{
"id": 120,
"text": "Action Required: Need more images",
"created_at": "2016-04-22T15:00:30Z",
"salesperson": {
"id": 3,
"full_name": "Steven Sales",
"type": "Salesperson"
},
"fulfilling_comment": null
}
],
"comments": [
{
"id": 237,
"text": "Lead Comment.",
"recording_url": null,
"photo_urls": [],
"created_at": "2016-01-26T19:04:39Z",
"user": {
"id": 2,
"full_name": "Ben S",
"type": "Salesperson"
},
"fulfilled_action": null
}
],
"reminders": [],
"status_updates": [
{
"status": "work_in_progress",
"previous_status": "received_by_sales",
"status_string": "Working...",
"previous_status_string": "Received",
"created_at": "2016-01-22T05:42:18Z",
"user": {
"id": 2,
"full_name": "Ben S",
"type": "Salesperson"
},
"comment_string": "Ben S has set status to 'Working...'."
}
],
"worker": {
"full_name": "William Worker",
"id": 5550,
"type": "Worker"
},
"salesperson": {
"full_name": "Sally Salesperson",
"id": 5551,
"type": "Salesperson"
},
}
]
}
This endpoint retrieves all leads for the given user authenticated from the auth_token header.
HTTP Request
GET https://fly.wingmateapp.com/api/v1.0/leads
Get a lead
curl "https://fly.wingmateapp.com/api/v1.0/leads/:lead_id"
-X GET
-H "Authorization: Bearer YourWingmateAPIKey"
-H "auth_token: usersAuthToken"
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/leads/:lead_id')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
req['auth_token'] = "usersAuthToken"
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
"auth_token": "usersAuthToken"
}
body = None
conn.request("GET", "/v1.0/leads/:lead_id", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/leads/:lead_id",
{
method: 'GET',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
'auth_token': 'usersAuthToken'
},
}
);
return await response.json();
The above command returns JSON structured like this:
{
"lead": {
"id": 1092443,
"campaign_id": 23492,
"description": "New Business Lead - Check it out",
"latitude": 123.456789,
"longitude": -123.456789,
"status": "work_in_progress",
"address": "1234 Example St, Toronto",
"photo_urls": [
"https://wingmatepro.com/lead_109.jpg"
],
"recording_url": null,
"thumbnail_url": "https://wingmatepro.com/lead_109_thumbnail.jpg",
"status_string": "In Progress",
"status_bar_colour": "#214300",
"created_at": "2015-12-11T22:55:17Z",
"updated_at": "2016-05-18T17:41:26Z",
"actions": [
{
"id": 120,
"text": "Action Required: Need more images",
"created_at": "2016-04-22T15:00:30Z",
"salesperson": {
"id": 3,
"full_name": "Steven Sales",
"type": "Salesperson"
},
"fulfilling_comment": null
}
],
"comments": [
{
"id": 237,
"text": "Lead Comment.",
"recording_url": null,
"photo_urls": [],
"created_at": "2016-01-26T19:04:39Z",
"user": {
"id": 2,
"full_name": "Ben S",
"type": "Salesperson"
},
"fulfilled_action": null
}
],
"reminders": [],
"status_updates": [
{
"status": "work_in_progress",
"previous_status": "received_by_sales",
"status_string": "Working...",
"previous_status_string": "Received",
"created_at": "2016-01-22T05:42:18Z",
"user": {
"id": 2,
"full_name": "Ben S",
"type": "Salesperson"
},
"comment_string": "Ben S has set status to 'Working...'."
}
],
"worker": {
"full_name": "William Worker",
"id": 5550,
"type": "Worker"
},
"salesperson": {
"full_name": "Sally Salesperson",
"id": 5551,
"type": "Salesperson"
},
}
}
This endpoint retrieves all details of a specified lead.
HTTP Request
GET https://fly.wingmateapp.com/api/v1.0/leads/:lead_id
URL Parameters
Parameter | Description | Parameter Type |
---|---|---|
lead_id | The ID of the lead to retrieve | Integer |
Update a lead
curl "https://fly.wingmateapp.com/api/v1.0/leads/:lead_id"
-X PUT
-H "Authorization: Bearer YourWingmateAPIKey"
-H "auth_token: usersAuthToken"
--data '{"lead":{"status":"work_in_progress"}}'
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/leads/:lead_id')
req = Net::HTTP::Put.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
req['auth_token'] = "usersAuthToken"
request.body = '{"lead":{"status":"work_in_progress"}}';
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
"auth_token": "usersAuthToken"
}
body = {"lead":{"status":"work_in_progress"}}
conn.request("PUT", "/v1.0/leads/:lead_id", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/leads/:lead_id",
{
method: 'PUT',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
'auth_token': 'usersAuthToken'
},
body: {"lead":{"status":"work_in_progress"}}
}
);
return await response.json();
The above command returns JSON structured like this:
{
"lead": {
"id": 1092443,
"campaign_id": 23492,
"description": "New Business Lead - Check it out",
"latitude": 123.456789,
"longitude": -123.456789,
"status": "work_in_progress",
"address": "1234 Example St, Toronto",
"photo_urls": [
"https://wingmatepro.com/lead_109.jpg"
],
"recording_url": null,
"thumbnail_url": "https://wingmatepro.com/lead_109_thumbnail.jpg",
"status_string": "In Progress",
"status_bar_colour": "#214300",
"created_at": "2015-12-11T22:55:17Z",
"updated_at": "2016-05-18T17:41:26Z",
"actions": [
{
"id": 120,
"text": "Action Required: Need more images",
"created_at": "2016-04-22T15:00:30Z",
"salesperson": {
"id": 3,
"full_name": "Steven Sales",
"type": "Salesperson"
},
"fulfilling_comment": null
}
],
"comments": [
{
"id": 237,
"text": "Lead Comment.",
"recording_url": null,
"photo_urls": [],
"created_at": "2016-01-26T19:04:39Z",
"user": {
"id": 2,
"full_name": "Ben S",
"type": "Salesperson"
},
"fulfilled_action": null
}
],
"reminders": [],
"status_updates": [
{
"status": "work_in_progress",
"previous_status": "received_by_sales",
"status_string": "Working...",
"previous_status_string": "Received",
"created_at": "2016-01-22T05:42:18Z",
"user": {
"id": 2,
"full_name": "Ben S",
"type": "Salesperson"
},
"comment_string": "Ben S has set status to 'Working...'."
}
],
"worker": {
"full_name": "William Worker",
"id": 5550,
"type": "Worker"
},
"salesperson": {
"full_name": "Sally Salesperson",
"id": 5551,
"type": "Salesperson"
},
}
}
This endpoint updates a specified lead with the given request. The user authenticated from the auth_token
header will be used as the updating user.
HTTP Request
PUT https://fly.wingmateapp.com/api/v1.0/leads/:lead_id
URL Parameters
Parameter | Description | Parameter Type |
---|---|---|
lead_id | The ID of the lead to retrieve | Integer |
lead:salesperson_id | The ID of the salesperson assigned to the lead | Integer |
lead:description | A text description for the lead | String |
lead:address | The address of the lead (auto-generated if latitude/longitude are specified) | String |
lead:latitude | The latitude coordinate for the lead's location | Decimal |
lead:longitude | The longitude coordinate for the lead's location | Decimal |
lead:recording_url | A url to a mp3 file for a recorded description | String |
lead:thumbnail_url | A url to the image of the lead | String |
lead:custom_fields | A hash of values for your campaigns custom fields for leads | hash |
lead:photo_urls | Any additional urls for images for the leads | Array |
lead:status | The current status of the lead in the Wingmate CRM Pipeline | String |
lead:amount | Estimated value of the lead | Decimal |
Delete a lead
curl "https://fly.wingmateapp.com/api/v1.0/leads/:lead_id"
-X DELETE
-H "Authorization: Bearer YourWingmateAPIKey"
-H "auth_token: usersAuthToken"
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/leads/:lead_id')
req = Net::HTTP::Delete.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
req['auth_token'] = "usersAuthToken"
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
"auth_token": "usersAuthToken"
}
body = None
conn.request("DELETE", "/v1.0/leads/:lead_id", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/leads/:lead_id",
{
method: 'DELETE',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
'auth_token': 'usersAuthToken'
},
}
);
return await response.json();
The above command will return a status of 200 if the lead is deleted successfully
Deletes the lead from your campaign.
HTTP Request
DELETE https://fly.wingmateapp.com/api/v1.0/leads/:lead_id
URL Parameters
Parameter | Description | Parameter Type |
---|---|---|
lead_id | The ID of the lead to retrieve | Integer |
Lead Activity Feed
Get Actions on a Lead
curl "https://fly.wingmateapp.com/api/v1.0/leads/:lead_id/actions"
-X GET
-H "Authorization: Bearer YourWingmateAPIKey"
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/leads/:lead_id/actions')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
}
body = None
conn.request("GET", "/v1.0/leads/:lead_id/actions", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/leads/:lead_id/actions",
{
method: 'GET',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
},
}
);
return await response.json();
The above command returns JSON structured like this:
{
"actions": [{
"id": 166,
"text": "Please talk to them and get a contact number, thanks.",
"lead": {
"id": 804
},
"created_at": "2018-07-20T17:37:47Z",
"user": {
"id": 476,
"full_name": "Martin Manager",
"type": "Manager"
},
"fulfilling_comment": {
"id": 1134
}
}
]
}
Gets all of the actions that have been created on a lead
HTTP Request
GET https://fly.wingmateapp.com/api/v1.0/leads/:lead_id/actions
Query Parameters
Parameter | Description | Param Type |
---|---|---|
lead_id | The id of the lead. | Integer |
Create an Action on a Lead
curl "https://fly.wingmateapp.com/api/v1.0/leads/:lead_id/actions"
-X POST
-H "Authorization: Bearer YourWingmateAPIKey"
--data '{"action":{"user_id":1,"fulfilling_comment_id":2,"text":"Please follow up with this lead."}}'
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/leads/:lead_id/actions')
req = Net::HTTP::Post.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
request.body = '{"action":{"user_id":1,"fulfilling_comment_id":2,"text":"Please follow up with this lead."}}';
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
}
body = {"action":{"user_id":1,"fulfilling_comment_id":2,"text":"Please follow up with this lead."}}
conn.request("POST", "/v1.0/leads/:lead_id/actions", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/leads/:lead_id/actions",
{
method: 'POST',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
},
body: {"action":{"user_id":1,"fulfilling_comment_id":2,"text":"Please follow up with this lead."}}
}
);
return await response.json();
The above command returns JSON structured like this:
{
"action": {
"id": 166,
"text": "Please talk to them and get a contact number, thanks.",
"lead": {
"id": 804
},
"created_at": "2018-07-20T17:37:47Z",
"user": {
"id": 476,
"full_name": "Martin Manager",
"type": "Manager"
},
"fulfilling_comment": {
"id": 1134
}
}
}
Create an Action Request on a lead for the Frontline member who generated the lead.
HTTP Request
POST https://fly.wingmateapp.com/api/v1.0/leads/:lead_id/actions
Query Parameters
Parameter | Description | Param Type |
---|---|---|
lead_id | The id of the lead. | Integer |
actions:user_id | The ID of the user who generated the Action Request | Integer |
actions:fulfilling_comment_id | The ID of the comment that fulfills the action | Integer |
actions:text | The text of the Action Request | String |
Get Comments on a Lead
curl "https://fly.wingmateapp.com/api/v1.0/leads/:lead_id/comments"
-X GET
-H "Authorization: Bearer YourWingmateAPIKey"
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/leads/:lead_id/comments')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
}
body = None
conn.request("GET", "/v1.0/leads/:lead_id/comments", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/leads/:lead_id/comments",
{
method: 'GET',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
},
}
);
return await response.json();
The above command returns JSON structured like this:
{
"comments": [{
"id": 72,
"lead": {
"id": 35
},
"text": "Hi, great lead!",
"type": "PhoneCorrespondence",
"recording_url": null,
"photo_urls": [],
"created_at": "2015-05-25T18:04:49Z",
"user": {
"id": 2,
"full_name": "Aiden C",
"type": "Salesperson"
},
"fulfilled_action": null
}
]
}
Gets all of the comments that have been created on a lead
HTTP Request
GET https://fly.wingmateapp.com/api/v1.0/leads/:lead_id/comments
Query Parameters
Parameter | Description | Param Type |
---|---|---|
lead_id | The id of the lead. | Integer |
Create a Comment on a Lead
curl "https://fly.wingmateapp.com/api/v1.0/leads/:lead_id/comments"
-X POST
-H "Authorization: Bearer YourWingmateAPIKey"
--data '{"comment":{"text":"Hi, great lead!","user_id":2}}'
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/leads/:lead_id/comments')
req = Net::HTTP::Post.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
request.body = '{"comment":{"text":"Hi, great lead!","user_id":2}}';
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
}
body = {"comment":{"text":"Hi, great lead!","user_id":2}}
conn.request("POST", "/v1.0/leads/:lead_id/comments", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/leads/:lead_id/comments",
{
method: 'POST',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
},
body: {"comment":{"text":"Hi, great lead!","user_id":2}}
}
);
return await response.json();
The above command returns JSON structured like this:
{
"comment": {
"id": 72,
"lead": {
"id": 35
},
"text": "Hi, great lead!",
"type": "PhoneCorrespondence",
"recording_url": null,
"photo_urls": [],
"created_at": "2015-05-25T18:04:49Z",
"user": {
"id": 2,
"full_name": "Aiden C",
"type": "Salesperson"
},
"fulfilled_action": null
}
}
Gets all of the comments that have been created on a lead
HTTP Request
POST https://fly.wingmateapp.com/api/v1.0/leads/:lead_id/comments
Query Parameters
Parameter | Description | Param Type | Optional? |
---|---|---|---|
lead_id | The id of the lead | Integer | Required |
comment:user_id | The ID of the user who commented | Integer | Required |
comment:text | The text of the comment | String | Required |
comment:recording_url | A URL to an mp3 recording for the comment | String | Optional |
comment:photo_urls | An array of URLs to images attached to the comment | Array | Optional |
comment:fulfilled_action_id | The ID of the action which this comment fulfills | Integer | Optional |
Get Reminders on a Lead
curl "https://fly.wingmateapp.com/api/v1.0/leads/:lead_id/reminders"
-X GET
-H "Authorization: Bearer YourWingmateAPIKey"
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/leads/:lead_id/reminders')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
}
body = None
conn.request("GET", "/v1.0/leads/:lead_id/reminders", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/leads/:lead_id/reminders",
{
method: 'GET',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
},
}
);
return await response.json();
The above command returns JSON structured like this:
{
"reminders": [{
"id": 32,
"text": "Reminder to follow up with our contact",
"date": "2019-12-31T05:00:00Z",
"created_at": "2019-12-30T18:02:53Z",
"completed_at": "2020-01-11T07:36:13Z",
"lead": {
"id": 915
},
"user": {
"id": 298,
"full_name": "Sally Salesperson",
"type": "Salesperson"
}
}
]
}
Gets all of the reminders that have been created on a lead
HTTP Request
GET https://fly.wingmateapp.com/api/v1.0/leads/:lead_id/reminders
Query Parameters
Parameter | Description | Param Type |
---|---|---|
lead_id | The id of the lead. | Integer |
Create a Reminder on a Lead
curl "https://fly.wingmateapp.com/api/v1.0/leads/:lead_id/reminders"
-X POST
-H "Authorization: Bearer YourWingmateAPIKey"
--data '{"reminder":{"user_id":1,"date":"2009-02-15T00:00:00Z","text":"Follow up with contact"}}'
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/leads/:lead_id/reminders')
req = Net::HTTP::Post.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
request.body = '{"reminder":{"user_id":1,"date":"2009-02-15T00:00:00Z","text":"Follow up with contact"}}';
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
}
body = {"reminder":{"user_id":1,"date":"2009-02-15T00:00:00Z","text":"Follow up with contact"}}
conn.request("POST", "/v1.0/leads/:lead_id/reminders", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/leads/:lead_id/reminders",
{
method: 'POST',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
},
body: {"reminder":{"user_id":1,"date":"2009-02-15T00:00:00Z","text":"Follow up with contact"}}
}
);
return await response.json();
The above command returns JSON structured like this:
{
"reminder": {
"id": 32,
"text": "Reminder to follow up with our contact",
"date": "2019-12-31T05:00:00Z",
"created_at": "2019-12-30T18:02:53Z",
"completed_at": "2020-01-11T07:36:13Z",
"lead": {
"id": 915
},
"user": {
"id": 298,
"full_name": "Sally Salesperson",
"type": "Salesperson"
}
}
}
Gets all of the reminders that have been created on a lead
HTTP Request
POST https://fly.wingmateapp.com/api/v1.0/leads/:lead_id/reminders
Query Parameters
Parameter | Description | Param Type |
---|---|---|
lead_id | The ID of the lead | Integer |
reminder:user_id | The ID of the user that the Reminder is for | Integer |
reminder:date | The date/time that the reminder is for | DateTime (ISO 8601) |
reminder:created_by_id | The ID of the user that generated the Reminder | Integer |
reminder:text | The text of the Reminder | String |
Get Status Updates on a Lead
curl "https://fly.wingmateapp.com/api/v1.0/leads/:lead_id/status_updates"
-X GET
-H "Authorization: Bearer YourWingmateAPIKey"
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/leads/:lead_id/status_updates')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
}
body = None
conn.request("GET", "/v1.0/leads/:lead_id/status_updates", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/leads/:lead_id/status_updates",
{
method: 'GET',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
},
}
);
return await response.json();
The above command returns JSON structured like this:
{
"status_updates": [{
"id": 888,
"comment_string": "Mike Manager has set status to 'Working'.",
"created_at": "2020-01-16T05:49:24Z",
"created_by_system": false,
"lead": {
"id": 555
},
"previous_status": "fresh",
"previous_status_string": "New",
"reassignment": false,
"status": "work_in_progress",
"status_string": "Working",
"user": {
"full_name": "Mike Manager",
"id": 333,
"type": "Manager"
}
}
]
}
Gets all of the status updates that have been generated on a lead
HTTP Request
GET https://fly.wingmateapp.com/api/v1.0/leads/:lead_id/status_updates
Query Parameters
Parameter | Description | Param Type |
---|---|---|
lead_id | The id of the lead. | Integer |
Actions
Update an Action
curl "https://fly.wingmateapp.com/api/v1.0/leads/:lead_id/actions"
-X PUT
-H "Authorization: Bearer YourWingmateAPIKey"
--data '{"action":{"fulfilling_comment_id":2}}'
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/leads/:lead_id/actions')
req = Net::HTTP::Put.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
request.body = '{"action":{"fulfilling_comment_id":2}}';
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
}
body = {"action":{"fulfilling_comment_id":2}}
conn.request("PUT", "/v1.0/leads/:lead_id/actions", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/leads/:lead_id/actions",
{
method: 'PUT',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
},
body: {"action":{"fulfilling_comment_id":2}}
}
);
return await response.json();
The above command returns JSON structured like this:
{
"action": {
"id": 166,
"text": "Please talk to them and get a contact number, thanks.",
"lead": {
"id": 804
},
"created_at": "2018-07-20T17:37:47Z",
"user": {
"id": 476,
"full_name": "Martin Manager",
"type": "Manager"
},
"fulfilling_comment": {
"id": 1134
}
}
}
Updates an action request with the given information.
HTTP Request
PUT https://fly.wingmateapp.com/api/v1.0/actions/:action_id
Query Parameters
Parameter | Description | Param Type |
---|---|---|
lead_id | The id of the lead. | Integer |
actions:user_id | The ID of the user who generated the Action Request | Integer |
actions:fulfilling_comment_id | The ID of the comment that fulfills the action | Integer |
actions:text | The text of the Action Request | String |
Delete an Action
curl "https://fly.wingmateapp.com/api/v1.0/leads/:lead_id/actions"
-X DELETE
-H "Authorization: Bearer YourWingmateAPIKey"
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/leads/:lead_id/actions')
req = Net::HTTP::Delete.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
}
body = None
conn.request("DELETE", "/v1.0/leads/:lead_id/actions", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/leads/:lead_id/actions",
{
method: 'DELETE',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
},
}
);
return await response.json();
The above command returns a 200 status if the action is destroyed
Deletes the specified action.
HTTP Request
DELETE https://fly.wingmateapp.com/api/v1.0/actions/:action_id
Comments
Update a Comment
curl "https://fly.wingmateapp.com/api/v1.0/comments/:comment_id"
-X PUT
-H "Authorization: Bearer YourWingmateAPIKey"
--data '{"comment":{"text":"Please follow up with this lead."}}'
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/comments/:comment_id')
req = Net::HTTP::Put.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
request.body = '{"comment":{"text":"Please follow up with this lead."}}';
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
}
body = {"comment":{"text":"Please follow up with this lead."}}
conn.request("PUT", "/v1.0/comments/:comment_id", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/comments/:comment_id",
{
method: 'PUT',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
},
body: {"comment":{"text":"Please follow up with this lead."}}
}
);
return await response.json();
The above command returns JSON structured like this:
{
"comment": {
"id": 72,
"lead": {
"id": 35
},
"text": "Hi, great lead!",
"type": "PhoneCorrespondence",
"recording_url": null,
"photo_urls": [],
"created_at": "2015-05-25T18:04:49Z",
"user": {
"id": 2,
"full_name": "Aiden C",
"type": "Salesperson"
},
"fulfilled_action": null
}
}
Updates a comment with the given information.
HTTP Request
PUT https://fly.wingmateapp.com/api/v1.0/comments/:comment_id
Query Parameters
Parameter | Description | Param Type |
---|---|---|
comment_id | The id of the comment to update | Integer |
comment:text | The text of the comment | String |
comment:recording_url | A URL to an mp3 recording for the comment | String |
comment:photo_urls | An array of URLs to images attached to the comment | Array |
comment:user_id | The ID of the user who commented | Integer |
Delete a Comment
curl "https://fly.wingmateapp.com/api/v1.0/comments/:comment_id"
-X DELETE
-H "Authorization: Bearer YourWingmateAPIKey"
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/comments/:comment_id')
req = Net::HTTP::Delete.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
}
body = None
conn.request("DELETE", "/v1.0/comments/:comment_id", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/comments/:comment_id",
{
method: 'DELETE',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
},
}
);
return await response.json();
The above request will return with a status of 200 if it is successful
Deletes the specified action.
HTTP Request
DELETE https://fly.wingmateapp.com/api/v1.0/comments/:comment_id
Query Parameters
Parameter | Description | Param Type |
---|---|---|
comment_id | The id of the comment to delete | Integer |
Reminders
Get a Reminder
curl "https://fly.wingmateapp.com/api/v1.0/reminders/:reminder_id"
-X GET
-H "Authorization: Bearer YourWingmateAPIKey"
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/reminders/:reminder_id')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
}
body = None
conn.request("GET", "/v1.0/reminders/:reminder_id", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/reminders/:reminder_id",
{
method: 'GET',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
},
}
);
return await response.json();
The above command returns JSON structued like this:
{
"reminder": {
"id": 32,
"text": "Reminder to follow up with our contact",
"date": "2019-12-31T05:00:00Z",
"created_at": "2019-12-30T18:02:53Z",
"completed_at": "2020-01-11T07:36:13Z",
"lead": {
"id": 915
},
"user": {
"id": 298,
"full_name": "Sally Salesperson",
"type": "Salesperson"
}
}
}
Returns the information of a reminder
HTTP Request
GET https://fly.wingmateapp.com/api/v1.0/reminders/:reminder_id
Query Parameters
Parameter | Description | Param Type |
---|---|---|
reminder_id | The id of the reminder to retrieve information for | Integer |
Update a Reminder
curl "https://fly.wingmateapp.com/api/v1.0/reminders/:reminder_id"
-X PUT
-H "Authorization: Bearer YourWingmateAPIKey"
--data '{"reminder":{"text":"Reminding you to follow up"}}'
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/reminders/:reminder_id')
req = Net::HTTP::Put.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
request.body = '{"reminder":{"text":"Reminding you to follow up"}}';
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
}
body = {"reminder":{"text":"Reminding you to follow up"}}
conn.request("PUT", "/v1.0/reminders/:reminder_id", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/reminders/:reminder_id",
{
method: 'PUT',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
},
body: {"reminder":{"text":"Reminding you to follow up"}}
}
);
return await response.json();
The above command returns JSON structured like this:
{
"reminder": {
"id": 32,
"text": "Reminder to follow up with our contact",
"date": "2019-12-31T05:00:00Z",
"created_at": "2019-12-30T18:02:53Z",
"completed_at": "2020-01-11T07:36:13Z",
"lead": {
"id": 915
},
"user": {
"id": 298,
"full_name": "Sally Salesperson",
"type": "Salesperson"
}
}
}
Updates a reminder with the given information.
HTTP Request
PUT https://fly.wingmateapp.com/api/v1.0/reminders/:reminder_id
Query Parameters
Parameter | Description | Param Type |
---|---|---|
reminder_id | The ID of the reminder | Integer |
reminder:lead_id | The ID of the lead the Reminder is for | Integer |
reminder:user_id | The ID of the user that the Reminder is for | Integer |
reminder:date | The date/time that the reminder is for | DateTime (ISO 8601) |
reminder:completed_at | The date/time that the reminder was completed | DateTime (ISO 8601) |
reminder:created_by_id | The ID of the user that generated the Reminder | Integer |
reminder:text | The text of the Reminder | String |
Delete a Reminder
curl "https://fly.wingmateapp.com/api/v1.0/reminders/:reminder_id"
-X DELETE
-H "Authorization: Bearer YourWingmateAPIKey"
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/reminders/:reminder_id')
req = Net::HTTP::Delete.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
}
body = None
conn.request("DELETE", "/v1.0/reminders/:reminder_id", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/reminders/:reminder_id",
{
method: 'DELETE',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
},
}
);
return await response.json();
The above reminder will return with a status of 200 if it is successful
Deletes the specified reminder.
HTTP Request
DELETE https://fly.wingmateapp.com/api/v1.0/reminders/:reminder_id
Query Parameters
Parameter | Description | Param Type |
---|---|---|
reminder_id | The ID of the Reminder | Integer |
Notifications
Update a Notification
curl "https://fly.wingmateapp.com/api/v1.0/notifications/:notification_id"
-X PUT
-H "Authorization: Bearer YourWingmateAPIKey"
--data '{"notification":{"text":"New Notifiaction text"}}'
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/notifications/:notification_id')
req = Net::HTTP::Put.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
request.body = '{"notification":{"text":"New Notifiaction text"}}';
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
}
body = {"notification":{"text":"New Notifiaction text"}}
conn.request("PUT", "/v1.0/notifications/:notification_id", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/notifications/:notification_id",
{
method: 'PUT',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
},
body: {"notification":{"text":"New Notifiaction text"}}
}
);
return await response.json();
The above command returns JSON structured like this:
{
"notification": {
"id": 87,
"text": "Congratulations! You have earned $1000.00 for lead #491 turning into new business!",
"html_item": "<link href='//fonts.googleapis.com/css?family=Roboto:500,400italic,700italic,300,700,500italic,400' rel='stylesheet' type='text/css'><link rel=\\\"stylesheet\\\" href=\\\"//maxcdn.bootstrapcdn.com/font-awesome/4.6.0/css/font-awesome.min.css\\\"><style> body { width: 100%; height: 100%; } h1 { text-align: center; font-family: Roboto; } h4 { } h1, h2, h3, h4, h5, h6 { font-family: Roboto, Helvetica, Arial; font-weight: normal; color: $darkGrey; margin-top: 0; }</style><body> <h1>Congratulations!</h1> <hr> <h4> Congratulations! You have earned $1000.00 for lead #491 turning into new business! </h4></body>",
"created_at": "2019-04-26T14:57:41Z",
"lead": {
"id": 491,
"description": "Potential lead",
"latitude": 123.4567890,
"longitude": -123.4567890,
"status": "completed",
"address": "1 Bloor St West, Toronto, ON",
"photo_urls": [],
"recording_url": null,
"thumbnail_url": "",
"rating_of_worker": 4,
"rating_of_worker_comment": "almost got there!",
"rating_of_sales": 3,
"rating_of_sales_comment": "Fantastic lead!",
"created_at": "2016-05-05T19:35:30Z",
"updated_at": "2019-04-28T16:13:16Z",
"amount": 0.0
},
"viewed": false,
"type": "Notification"
}
}
Updates a request with the given information.
HTTP Request
PUT https://fly.wingmateapp.com/api/v1.0/notifications/:notification_id
Query Parameters
Parameter | Description | Param Type |
---|---|---|
notification_id | The ID of the notification to be edited | Integer |
notification:viewed | A Boolean representing whether the notification was viewed or not | Boolean |
notification:text | The new text string for the notification | String |
notification:lead_id | The new lead the notification is attached to | Integer |
notification:html_item | The new html item to be rendered in app upon click | String |
Delete a Notification
curl "https://fly.wingmateapp.com/api/v1.0/notifications/:notification_id"
-X DELETE
-H "Authorization: Bearer YourWingmateAPIKey"
require 'net/http'
uri = URI('https://fly.wingmateapp.com/api/v1.0/notifications/:notification_id')
req = Net::HTTP::Delete.new(uri)
req['Authorization'] = "Bearer YourWingmateAPIKey"
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
http.request(req)
}
import http.client
conn = http.client.HTTPSConnection("https://fly.wingmateapp.com/api")
headers = {
"Authorization": "Bearer YourWingmateAPIKey",
}
body = None
conn.request("DELETE", "/v1.0/notifications/:notification_id", body, headers)
const response = await fetch(
"https://fly.wingmateapp.com/api/v1.0/notifications/:notification_id",
{
method: 'DELETE',
headers: {
'Authorization': 'Bearer YourWingmateAPIKey',
},
}
);
return await response.json();
The above request will return with a status of 200 if it is successful
Deletes the specified action.
HTTP Request
DELETE https://fly.wingmateapp.com/api/v1.0/notifications/:notification_id
Errors
The Wingmate API uses the following error codes:
Error Code | Meaning |
---|---|
400 | Bad Request -- Your request is invalid. |
401 | Unauthorized -- Your API key is wrong. |
403 | Forbidden -- The resource cannot be accessed by you. |
404 | Not Found -- The specified resource could not be found. |
405 | Method Not Allowed -- You tried to access the API with an invalid method. |
406 | Not Acceptable -- You requested a format that isn't available. |
410 | Gone -- The resource requested has been removed from our servers. |
418 | I'm a teapot. |
429 | Too Many Requests -- You've made too many requests in a small time frame. |
500 | Internal Server Error -- We had a problem with our server. Try again later. |
503 | Service Unavailable -- We're temporarily offline for maintenance. Please try again later. |
Built: 2020-12-18 00:59:22 -0500