Introduction
Welcome to the Replyify API! You can use our API to access Replyify API endpoints to interact on behalf of a user using OAuth2.
We have language bindings in Shell, and Python! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.
Authentication
To authorize, use this code:
import replyify
# retrieve the access token from you data store and set it like this:
replyify.access_token = '{{ OAUTH2_ACCESS_TOKEN }}'
# With shell, you can just pass the correct header with each request
curl --header "Authorization: Bearer {{ OAUTH2_ACCESS_TOKEN }}" \
"{{ API ENDPOINT HERE }}"
Make sure to replace
OAUTH2_ACCESS_TOKENwith the access token you receive for the user during the OAuth2 workflow.
Replyify uses access tokens to allow access to the API and expects the token to be included in all API requests to the server in a header that looks like the following:
Authorization: Bearer {{ OAUTH2_ACCESS_TOKEN }}
Campaigns
Campaigns are objects representing a workflow in Replyify for a specific segment of contacts. You can think of a campaign as a container which holds, contacts, settings and the workflow timeline. You can control what days the campaign with execute, the time of day to begin execution and pause or resume a campaign.
The campaign object
here are some more descriptions about the object
Example Response:
{
"guid": "asdf-1234-5678-zxcv",
"name": "My Super Campaign",
"description": "This will be the best campaign in history",
"execution_start_time": "10:00",
"execute_sunday": true,
"execute_monday": true,
"execute_tuesday": true,
"execute_wednesday": true,
"execute_thursday": true,
"execute_friday": true,
"execute_saturday": false,
"is_enabled": true,
"updated": "",
"created": ""
}
Attributes
| Name | Type | Description |
|---|---|---|
| guid | string (40) | Replyify Global Unique Identifier |
| name | string (255) | Name of the the campaign |
| description | text | Longer description of the campaign |
| execution_start_time | time (24h - 00:00:00) | Earliest time of day the campaign will begin execution |
| execute_sunday | boolean | Include execution on Sunday |
| execute_monday | boolean | Include execution on Monday |
| execute_tuesday | boolean | Include execution on Tuesday |
| execute_wednesday | boolean | Include execution on Wednesday |
| execute_thursday | boolean | Include execution on Thursday |
| execute_friday | boolean | Include execution on Friday |
| execute_saturday | boolean | Include execution on Saturday |
| is_enabled | boolean | If the campaign is currently enabled |
| updated | datetime | Last time instance has been changed |
| created | datetime | When the instance was originally created |
Create a campaign
import replyify
replyify.access_token = '{{ OAUTH2_ACCESS_TOKEN }}'
replyify.Campaign.create(
name='My Super Campaign',
description='This will be the best campaign in history',
exection_start_time='10:00',
execute_sunday=True,
is_enabled=True
)
curl --header "Authorization: Bearer {{ OAUTH2_ACCESS_TOKEN }}" \
--header "Content-Type: application/json" \
--request PATCH
--data '{"name": "My Super Campaign","description": "This will be the best campaign in history"}'
"https://api.replyify.com/campaign/v1"
The above command returns JSON structured like this:
{
"status": 204,
"success": true,
"campaign": {
"guid": "asdf-1234-5678-zxcv",
"name": "My Super Campaign",
"description": "This will be the best campaign in history",
"execution_start_time": "10:00",
"execute_sunday": true,
"execute_monday": true,
"execute_tuesday": true,
"execute_wednesday": true,
"execute_thursday": true,
"execute_friday": true,
"execute_saturday": false,
"is_enabled": true,
"updated": "",
"created": ""
}
}
This endpoint creates a new campaign for a user.
HTTP Request
POST https://api.replyify.com/campaign/v1
Arguments
| Parameter | Default | Description |
|---|---|---|
| name | None | Required: Name of the new the campaign |
| description | None | Add a longer description of the campaign |
| execution_start_time | None | Required: Time of day to start campaign execution |
| execute_sunday | False | Include execution on Sunday |
| execute_monday | True | Include execution on Monday |
| execute_tuesday | True | Include execution on Tuesday |
| execute_wednesday | True | Include execution on Wednesday |
| execute_thursday | True | Include execution on Thursday |
| execute_friday | True | Include execution on Friday |
| execute_saturday | False | Include execution on Saturday |
| is_enabled | False | Toggle if the campaign should be enabled: use this to ‘Pause’ a campaign |
Retrieve a campaign
import replyify
replyify.access_token = '{{ OAUTH2_ACCESS_TOKEN }}'
replyify.Campaign.retrieve('asdf-1234-5678-zxcv')
curl --header "Authorization: Bearer {{ OAUTH2_ACCESS_TOKEN }}" \
"https://api.replyify.com/campaign/v1/asdf-1234-5678-zxcv"
The above command returns JSON structured like this:
{
"guid": "asdf-1234-5678-zxcv",
"name": "My Super Campaign",
"description": "I will be super campaigning people so hard",
"is_enabled": true,
"exection_start_time": "10:00"
}
This endpoint retrieves a specific campaign.
HTTP Request
GET https://api.replyify.com/campaign/v1/<GUID>
URL Parameters
| Parameter | Description |
|---|---|
| GUID | The GUID of the campaign to retrieve |
Retrieve a campaign
import replyify
replyify.access_token = '{{ OAUTH2_ACCESS_TOKEN }}'
replyify.Campaign.modify('asdf-1234-5678-zxcv', execute_saturday=True, is_enabled=False)
curl --header "Authorization: Bearer {{ OAUTH2_ACCESS_TOKEN }}" \
"https://api.replyify.com/campaign/v1/asdf-1234-5678-zxcv"
Example JSON Response:
{
"status": 200,
"success": true,
"campaign": {
"guid": "asdf-1234-5678-zxcv",
"name": "My Super Campaign",
"description": "This will be the best campaign in history",
"execution_start_time": "10:00",
"execute_sunday": true,
"execute_monday": true,
"execute_tuesday": true,
"execute_wednesday": true,
"execute_thursday": true,
"execute_friday": true,
"execute_saturday": true,
"is_enabled": false,
"updated": "",
"created": ""
}
}
This endpoint updates the attributes of a campaign.
HTTP Request
PATCH https://api.replyify.com/campaign/v1/<GUID>
URL Parameters
| Parameter | Description |
|---|---|
| GUID | The GUID of the campaign to retrieve |
List campaigns
import replyify
replyify.access_token = '{{ OAUTH2_ACCESS_TOKEN }}'
replyify.Campaign.list()
curl --header "Authorization: Bearer {{ OAUTH2_ACCESS_TOKEN }}" \
"https://api.replyify.com/campaign/v1"
The above command returns JSON structured like this:
[
{
"id": 1,
"name": "Fluffums",
"breed": "calico",
"fluffiness": 6,
"cuteness": 7
},
{
"id": 2,
"name": "Max",
"breed": "unknown",
"fluffiness": 5,
"cuteness": 10
}
]
This endpoint retrieves all campaigns for a user.
HTTP Request
GET https://api.replyify.com/campaign/v1
Query Parameters
| Parameter | Default | Description |
|---|---|---|
| include_cats | false | If set to true, the result will also include cats. |
| available | true | If set to false, the result will include kittens that have already been adopted. |
Errors
The Replyify API uses the following error codes:
| Error Code | Meaning |
|---|---|
| 400 | Bad Request – Your request was malformed |
| 401 | Unauthorized – Your access token is wrong or missing |
| 403 | Forbidden – Your access token does not have access to the resource |
| 404 | Not Found – The specified object or endpoint could not be found |
| 405 | Method Not Allowed – You tried to access an endpoint with an invalid method |
| 406 | Not Acceptable – You requested a format that isn’t json |
| 410 | Gone – The endpoint requested has been removed from our servers |
| 422 | Parameter Error – Your request data raised a validation error |
| 429 | Too Many Requests – You’re making too many requests! Slow down! |
| 500 | Internal Server Error – We had a problem with our server. Try again later. |
| 503 | Service Unavailable – We’re temporarially offline for maintanance. Please try again later. |