### Call Data Writing GET Request Example
Source: https://retreaver.github.io/core-api-docs
Example of making a GET request to the Call Data Writing API to apply tags to a caller.
```curl
curl "https://reteaverdata.com/data_writing/:postback_key_uuid?caller_number=:caller_number&age=39&utm_campaign=auto"
```
--------------------------------
### HTTP Request Example for a Call
Source: https://retreaver.github.io/core-api-docs
This is an example of an HTTP GET request to retrieve call details. It includes the API endpoint, the call's UUID, your API key, and an optional company ID.
```http
GET https://api.retreaver.com/api/v2/calls/addcf985-017e-4962-be34-cf5d55e74afc.json?api_key=woofwoofwoof&company_id=1
```
--------------------------------
### Example Response for Get Contact
Source: https://retreaver.github.io/core-api-docs
This is an example of the JSON response structure when successfully retrieving a specific contact.
```json
{
"contact": {
"id": 2,
"contact_numbers": [
{
"number": "+18668987878",
"description": "Landline",
"id": 2
}
],
"tag_values": [
{
"key": "name",
"value": "Retreaver Support",
"operator": "==",
"id": 154060720
}
]
}
}
```
--------------------------------
### HTTP Request Example for Campaign Creation
Source: https://retreaver.github.io/core-api-docs
This example shows the HTTP request details for creating a campaign, including the endpoint, method, headers, and the JSON payload. It also includes query parameters for API key and company ID.
```http
POST https://api.retreaver.com/campaigns.json?api_key=woofwoofwoof&company_id=1
Content-Type: application/json
{"campaign":{"cid":"0044","name":"MyCampaign","message":"Thanks for calling, please press one to continue.","voice_gender":"Male","timers_attributes":[{"seconds":0,"url":"http://callpixels.com/click.html"},{"seconds":90,"url":"http://callpixels.com/sale.html"}],"menu_options_attributes":[{"option":"1","target_number":"+16474570424"}]}}
```
--------------------------------
### Example Response for Create Number Pool
Source: https://retreaver.github.io/core-api-docs
This is an example of the JSON response structure after successfully creating a new number pool.
```json
{
"number_pool": {
"id": 49,
"numbers_count": 0,
"country": "US",
"max_pool_size": 100,
"buffer_seconds": 0,
"updated_at": "2013-04-25T16:53:52Z",
"created_at": "2013-04-25T16:53:52Z",
"hide_embedded_access": true,
"google_analytics": true,
"afid": null,
"cid": "111",
"type": "Toll-free",
"reserve_size": 1,
"google_analytics_paths": [
{
"name": "Network timer (always)",
"path": "/callpixels/8ddc04aa-0020-45eb-89df-ed45b8ed43a7"
},
{
"name": "Network timer (connect)",
"path": "/callpixels/18135f62-00ff-4818-941d-d88b6a93f27d"
}
]
}
}
```
--------------------------------
### Example JSON Response for Calls
Source: https://retreaver.github.io/core-api-docs
This is an example of the JSON structure returned when retrieving recent calls.
```json
[{
"call":{
"uuid":"addcf985-017e-4962-be34-cf5d55e74afc",
"caller":"+17195220377",
"caller_zip":"80920",
"caller_state":"CO",
"caller_city":"COLORADO SPRINGS",
"caller_country":"US",
"dialed_call_duration":193,
"total_duration":204,
"status":"finished",
"start_time":"2012-04-29T12:29:40Z",
"forwarded_time":"2012-04-29T12:29:51Z",
"end_time":"2012-04-29T12:32:46Z",
"cid":"0003",
"afid":"03994",
"sid":null,
"dialed_number":"+18668987878",
"updated_at":"2012-04-29T12:29:46Z",
"created_at":"2012-04-29T12:29:40Z",
"recording_url":"http://callpixels.com/recordings/87d43a5f5c88041687f9fd1bb6a58d6f/call_17192096019_1342303189.mp3"
}
},
{
"call":{
"uuid":"8ae0aa38-0173-4e62-5342-cf5d55e74afe",
"caller":"+14166686981",
"caller_zip":null,
"caller_state":"ON",
"caller_city":"TORONTO",
"caller_country":"CA",
"dialed_call_duration":33,
"total_duration":40,
"status":"finished",
"start_time":"2012-04-29T12:29:40Z",
"forwarded_time":"2012-04-29T12:29:51Z",
"end_time":"2012-04-29T12:32:46Z",
"cid":"0003",
"afid":"03994",
"sid":null,
"dialed_number":"+18668987878",
"updated_at":"2012-04-29T12:29:46Z",
"created_at":"2012-04-29T12:29:40Z",
"recording_url":"http://callpixels.com/recordings/87d43a5f5c88041687f9fd1bb6a58d6f/call_17192096019_1342303189.mp3"
}
}]
```
--------------------------------
### Example Target JSON Response
Source: https://retreaver.github.io/core-api-docs
This is an example of the JSON structure returned when fetching targets. It includes details about each target and their associated target groups.
```json
[{
"target": {
"id": 6588,
"number": "+18668987878",
"sip_username": null,
"sip_password": null,
"cid_number_id": 10,
"obfuscate_cid": false,
"created_at": "2014-08-14T20:46:01.158-04:00",
"updated_at": "2016-06-28T13:02:52.964-04:00",
"object_key": "40a9a73ff97cb35a0a16d1ec89fd9eddcf3727df932cea9f0f7a5a8ba1684fed",
"tid": null,
"priority": 1,
"weight": 1,
"timeout_seconds": 15,
"timer_offset": 0,
"send_digits": null,
"concurrency_cap": null,
"calls_in_progress": 0,
"inband_signals": false,
"time_zone": "Eastern Time (US & Canada)",
"paused": false,
"paused_at": null,
"name": "Jason Cell",
"target_group_ids": [1, 2],
"target_groups": [
{
"id": 1,
"name": "West Coast",
"target_ids": [6588],
"concurrency_cap": null,
"calls_in_progress": 0,
"behavior": 1,
"priority": null,
"weight": null
},
{
"id": 2,
"name": "East Coast",
"target_ids": [6588],
"concurrency_cap": null,
"calls_in_progress": 0,
"behavior": 1,
"priority": null,
"weight": null
}
]
}
}]
```
--------------------------------
### RTB Reservation Response Example
Source: https://retreaver.github.io/core-api-docs
This is an example of the JSON response received after creating a reservation. It includes details like UUID, status, payout, duration, and SIP address.
```json
{
"uuid": "c6e4ce37-9b49-46af-bd8e-16cb7753499d",
"status": "reserved",
"retreaver_payout": 5.0,
"retreaver_seconds": 10,
"inbound_number": "+18772435010",
"sip_address": "c6e4ce37-9b49-46af-bd8e-16cb7753499d@sip.rtb.retreaver.com",
"expires_at": "2024-10-28T12:08:49.880Z"
}
```
--------------------------------
### Get All Campaigns
Source: https://retreaver.github.io/core-api-docs
Lists all campaigns in your account. Campaigns should be configured before creating numbers to reuse settings.
```bash
curl "https://api.retreaver.com/campaigns.json?api_key=woofwoofwoof&company_id=1"
```
```json
[{
"campaign":{
"cid":"111",
"name":"SuperFuntime",
"updated_at":"2012-07-15T03:40:24Z",
"created_at":"2012-04-16T13:50:21Z",
"record_calls":true,
"record_seconds":3600,
"dedupe_seconds":86400,
"affiliate_can_pull_number":false,
"show_key":"5e2ba674a8a1fb34dddcf850139ffdd9",
"greeting":{
"message":"Hi There! Press one to continue.",
"voice_gender":"Female"
},
"timers":[
{
"timer":{
"id":195,
"seconds":0,
"url":"http://www.thertrack.com/click.track?CID=[campaign_id]&AFID=[affiliate_id]&SID=[sub_id]"
}
},
{
"timer":{
"id":199,
"seconds":90,
"url":"http://www.thertrack.com/pixel.track?CID=[campaign_id]&AFID=[affiliate_id]&SID=[sub_id]&MerchantReferenceID=[caller_id]-[called_number]-[call_duration]"
}
}
],
"menu_options":[
{
"menu_option":{
"id":61,
"option":"1",
"target_cid":null,
"target_number":"+18987748833"
}
}
]
}
}]
```
--------------------------------
### HTTP Request for Date Range Filtering
Source: https://retreaver.github.io/core-api-docs
This example demonstrates the full HTTP GET request for filtering calls within a specific date and time range.
```http
GET https://api.retreaver.com/api/v2/calls.json?api_key=woofwoofwoof&company_id=1&created_at_start=2016-01-01T00:00:00+00:00&created_at_end=2016-01-02T00:00:00+00:00&page=1
```
--------------------------------
### Example Response for Get Number Pool
Source: https://retreaver.github.io/core-api-docs
This is an example of the JSON response structure when retrieving a specific number pool.
```json
{
"number_pool": {
"id": 1,
"numbers_count": 0,
"type": "Toll-free",
"country": "CA",
"max_pool_size": 10,
"buffer_seconds": 0,
"updated_at": "2013-04-25T16:16:51Z",
"created_at": "2013-04-25T16:16:51Z",
"google_analytics": false,
"hide_embedded_access": false,
"afid": "0001",
"cid": "111",
"reserve_size": 1
}
}
```
--------------------------------
### Update Company Response Example
Source: https://retreaver.github.io/core-api-docs
This is an example of the JSON response structure you will receive after successfully updating a company. It includes company details such as ID, name, and URL configurations.
```json
{
"company": {
"id": 2,
"name": "Retreaver",
"default_click_url": "http://callpixels.com/?a=[affiliate_id]&c=[campaign_id]&cp=js&s1=[sub_id]",
"default_sale_url": "http://callpixels.com/p.ashx?o=[campaign_id]&t=[call_log_id]-[caller_id]-[called_number]-[call_duration]-[call_recording_url]",
"created_at": "2012-04-15T05:44:10Z",
"updated_at": "2012-05-07T15:32:44Z"
}
}
```
--------------------------------
### Example Call Object Structure
Source: https://retreaver.github.io/core-api-docs
This is an example of the JSON structure returned when retrieving a specific call. It contains details like caller information, durations, status, and timestamps.
```json
{
"call":{
"uuid":"addcf985-017e-4962-be34-cf5d55e74afc",
"caller":"+17195220377",
"caller_zip":"80920",
"caller_state":"CO",
"caller_city":"COLORADO SPRINGS",
"caller_country":"US",
"dialed_call_duration":193,
"total_duration":204,
"status":"finished",
"start_time":"2012-04-29T12:29:40Z",
"forwarded_time":"2012-04-29T12:29:51Z",
"end_time":"2012-04-29T12:32:46Z",
"cid":"0003",
"afid":"03994",
"sid":null,
"dialed_number":"+18668987878",
"updated_at":"2012-04-29T12:29:46Z",
"created_at":"2012-04-29T12:29:40Z",
"recording_url":"http://callpixels.com/recordings/87d43a5f5c88041687f9fd1bb6a58d6f/call_17192096019_1342303189.mp3"
}
}
```
--------------------------------
### Fetch Second Page of Calls
Source: https://retreaver.github.io/core-api-docs
This example shows how to fetch the second page of call records. Continue this pattern for further pagination.
```curl
curl "https://api.retreaver.com/api/v2/calls.json?api_key=woofwoofwoof&page=2"
```
--------------------------------
### Get all Affiliates (XML)
Source: https://retreaver.github.io/core-api-docs
Retrieves a list of all affiliates in XML format. Requires company ID and API key.
```bash
curl "https://api.retreaver.com/api/v1/affiliates.xml?api_key=woofwoofwoof&company_id=1"
```
```xml
0002
Nancy
Drew
Acme
2012-05-03T15:56:01Z
2012-05-03T15:56:01Z
```
--------------------------------
### Call Data Writing POST Request Example
Source: https://retreaver.github.io/core-api-docs
Example of making a POST request to the Call Data Writing API to apply tags to a caller.
```curl
curl -X POST "https://reteaverdata.com/data_writing" \
-H "Content-Type: application/json" \
-d '{
"key": postback_key_uuid,
"caller_number": :caller_number,
"age": "39",
"utm_campaign": "auto"
}'
```
--------------------------------
### Link Header Example
Source: https://retreaver.github.io/core-api-docs
This is an example of the Link HTTP header returned by the Retreaver API for pagination. It indicates the URLs for the last and next pages.
```http
Link: ; rel="last", ; rel="next"
```
--------------------------------
### Example JSON Response for a Call
Source: https://retreaver.github.io/core-api-docs
This is an example of the JSON structure returned when successfully retrieving call details. It contains comprehensive information about the call, including caller details, durations, status, and associated data.
```json
{
"call": {
"uuid": "94079290-93f3-4527-9e78-88653aaf3c49",
"caller": "+13015236555",
"caller_number_sent": null,
"caller_zip": "28379",
"caller_state": "NC",
"caller_city": "Rockingham",
"caller_country": "US",
"dialed_call_duration": 0,
"total_duration": 43,
"ivr_duration": 26,
"hold_duration": 17,
"status": "finished",
"start_time": "2024-11-04T16:46:10.400Z",
"forwarded_time": null,
"end_time": "2024-11-04T16:46:54.037Z",
"cid": "1",
"afid": null,
"sid": null,
"dialed_number": "+16477159443",
"revenue": null,
"payout": null,
"postback_value": null,
"network_sale_timer_fired": null,
"affiliate_sale_timer_fired": null,
"target_sale_timer_fired": null,
"hung_up_by": "caller",
"duplicate": false,
"payable_duplicate": false,
"receivable_duplicate": false,
"callpixels_target_id": null,
"system_target_id": null,
"system_campaign_id": 9872,
"system_affiliate_id": null,
"fired_pixels_count": 5,
"charge_total": "0.07",
"keys_pressed": [
"1"
],
"repeat": true,
"affiliate_repeat": false,
"target_repeat": null,
"number_repeat": true,
"visitor_url": "https://example.com",
"company_id": 2,
"conversions_determined_at": "2024-11-04T16:47:14.698Z",
"updated_at": "2024-11-04T16:47:14.944Z",
"created_at": "2024-11-04T16:46:10.547Z",
"billable_minutes": 1,
"upstream_call_uuid": null,
"downstream_call_uuids": [],
"target_group": {},
"number": "+18886064349",
"converted": false,
"payable": false,
"receivable": false,
"conversion_seconds": null,
"tid": null,
"tags": {
"geo": "301,us,us-28379,us-nc",
"request_id": "0192f811-d35d-85a4-7722-b3e39a2b3b6e,0192f812-0a4b-ab38-b471-e8332fac7ceb",
"robodial_blacklist": "0",
"status": "success"
},
"fired_pixels": [
{
"fired_pixel": {
"url": "https://example.com",
"fire_order": 1,
"batch_uuid": "8530a03a-a661-4247-b80c-d4f3e4a52802",
"created_at": "2024-11-04T16:47:15.071Z",
"fired_at": null,
"status": "new",
"webhook_name": null
}
},
{
"fired_pixel": {
"url": "https://example.com",
"fire_order": 0,
"batch_uuid": "dce85836-8b98-4b03-91f6-b29ca9494aa9",
"created_at": "2024-11-04T16:46:10.937Z",
"fired_at": "2024-11-04T16:46:10.793Z",
"status": "fired",
"webhook_name": "Webhook 1"
}
},
{
"fired_pixel": {
"url": "https://example.com",
"fire_order": 0,
"batch_uuid": "c1b0c797-00bc-43ae-a5c4-4f58b2aa9278",
"created_at": "2024-11-04T16:46:24.788Z",
"fired_at": "2024-11-04T16:46:24.787Z",
"status": "fired",
"webhook_name": "Webhook 2"
}
},
{
"fired_pixel": {
"url": "https://example.com",
"fire_order": 0,
"batch_uuid": "3c117e83-6d94-43fa-971b-25e3599e59f9",
"created_at": "2024-11-04T16:46:24.920Z",
"fired_at": "2024-11-04T16:46:24.849Z",
"status": "fired",
"webhook_name": "Webhook 3"
}
},
{
"fired_pixel": {
"url": "https://example.com",
"fire_order": 0,
"batch_uuid": "7023c382-a52c-42f1-9339-a69e03942d5d",
"created_at": "2024-11-04T16:46:25.874Z",
"fired_at": "2024-11-04T16:46:25.873Z",
"status": "fired",
"webhook_name": "Webhook 4"
}
}
],
"via": "inbound-dial",
"rescued": false,
"campaign_id": 9872,
"campaign_name": "Retreaver Main - Sales & Support",
"number_id": 4906092,
"target_id": null,
"affiliate_name": null,
"connected": false,
"profit_gross": "-0.07",
"profit_net": 0,
"target_name": null,
"time_to_call_in_seconds": 168463,
"time_to_connect_in_seconds": 43,
"total_cost": "0.07"
}
}
```
--------------------------------
### Call Data Structure Example
Source: https://retreaver.github.io/core-api-docs
This is an example of the JSON structure returned when retrieving call data. It includes detailed information about each call, such as caller ID, duration, status, and associated conversion data.
```json
[
{
"call": {
"uuid": "f1abfb78-ab8a-4146-9946-8169fbcc6d6c",
"caller": "+13015236555",
"caller_number_sent": null,
"caller_zip": "28379",
"caller_state": "NC",
"caller_city": "Rockingham",
"caller_country": "US",
"dialed_call_duration": 2,
"total_duration": 14,
"ivr_duration": 7,
"hold_duration": 5,
"status": "finished",
"start_time": "2024-11-04T16:52:18.034Z",
"forwarded_time": "2024-11-04T16:52:25.423Z",
"end_time": "2024-11-04T16:52:32.882Z",
"cid": "1",
"afid": null,
"sid": null,
"dialed_number": "+12263399112",
"revenue": 5.0,
"payout": 5.0,
"postback_value": null,
"network_sale_timer_fired": null,
"affiliate_sale_timer_fired": null,
"target_sale_timer_fired": null,
"hung_up_by": "caller",
"duplicate": false,
"payable_duplicate": false,
"receivable_duplicate": false,
"callpixels_target_id": 27449,
"system_target_id": 27449,
"system_campaign_id": 9872,
"system_affiliate_id": null,
"fired_pixels_count": 4,
"charge_total": "0.08",
"keys_pressed": [
"1"
],
"repeat": true,
"affiliate_repeat": false,
"target_repeat": true,
"number_repeat": true,
"visitor_url": "https://example.com",
"company_id": 2,
"conversions_determined_at": "2024-11-04T16:52:54.744Z",
"updated_at": "2024-11-04T16:53:00.756Z",
"created_at": "2024-11-04T16:52:18.177Z",
"billable_minutes": 1,
"upstream_call_uuid": null,
"downstream_call_uuids": [],
"target_group": {
"id": 1639,
"name": "Retreaver Team"
},
"recording_url": "https://example.com",
"number": "+18886064349",
"converted": true,
"payable": true,
"receivable": true,
"conversion_seconds": null,
"tid": null,
"tags": {
"attempt": "0192f817-6fdc-f8b3-eb07-526dd16e2ade,0192f817-9147-eee3-25ea-e189df86dc6e",
"geo": "301,us,us-28379,us-nc",
"id": "0192f817-6fdc-f8b3-eb07-526dd16e2ade,0192f817-9147-eee3-25ea-e189df86dc6e",
"request_id": "0192f817-6fdc-f8b3-eb07-526dd16e2ade,0192f817-9147-eee3-25ea-e189df86dc6e",
"status": "success",
"system_target_id": "27449"
},
"fired_pixels": [
{
"fired_pixel": {
"url": "https://example.com",
"fire_order": 1,
"batch_uuid": "39d94d6b-639a-486b-bb21-dbba5949dd2e",
"created_at": "2024-11-04T16:52:55.182Z",
"fired_at": null,
"status": "new",
"webhook_name": null
}
},
{
"fired_pixel": {
"url": "https://example.com",
"fire_order": 0,
"batch_uuid": "343ccf9b-b3a1-4cd3-b2de-a351dcf40661",
"created_at": "2024-11-04T16:52:26.948Z",
"fired_at": "2024-11-04T16:52:26.947Z",
"status": "fired",
"webhook_name": "Test Webhook"
}
},
{
"fired_pixel": {
"url": "https://example.com",
"fire_order": 0,
"batch_uuid": "4ef5f708-aa5f-4918-9790-ffbe890a517d",
"created_at": "2024-11-04T16:52:27.154Z",
"fired_at": "2024-11-04T16:52:27.087Z",
"status": "fired",
"webhook_name": "Test Webhook"
}
},
{
"fired_pixel": {
"url": "https://example.com",
"fire_order": 0,
"batch_uuid": "982e0d22-dd8e-4476-8e89-d967285a6929",
"created_at": "2024-11-04T16:52:18.589Z",
"fired_at": "2024-11-04T16:52:18.533Z",
"status": "fired",
"webhook_name": "Test Webhook"
}
}
],
"via": "inbound-dial",
"rescued": false,
"campaign_id": 9872,
"campaign_name": "Retreaver Main - Sales & Support",
"number_id": 4906092,
"target_id": 27449,
"affiliate_name": null,
"connected": true,
"profit_gross": "-0.08",
"profit_net": 0.0,
"target_name": "Taylor Anderson - Sales - +12263399112",
"time_to_call_in_seconds": 168096,
"time_to_connect_in_seconds": 12,
"total_cost": "0.08"
}
},
{
"call": {
"uuid": "f6e88162-c6f9-4dd5-9739-652bdfc86874",
"caller": "+13015236555",
"caller_number_sent": null,
"caller_zip": "28379",
"caller_state": "NC",
"caller_city": "Rockingham",
"caller_country": "US",
"dialed_call_duration": 0,
"total_duration": 31,
"ivr_duration": 14,
"hold_duration": 17,
"status": "finished",
"start_time": "2024-11-04T16:51:41.815Z",
"forwarded_time": null,
```
--------------------------------
### Get All Companies
Source: https://retreaver.github.io/core-api-docs
Use this command to retrieve a list of all companies associated with your account. Ensure you replace 'woofwoofwoof' with your actual API key.
```bash
curl "https://api.retreaver.com/companies.json?api_key=woofwoofwoof"
```
```json
[
{
"company": {
"id": 1,
"name": "Foo Corp",
"created_at": "2015-10-08T15:23:31.777Z",
"updated_at": "2016-09-15T02:55:46.690Z",
"embedded_key": "6e1a3c121f83dad4c0bef78414b9e597",
"per_number": "1.0",
"use_global_suppression_list": true,
"balance": "200.0",
"owner_user_name": "Alice Bob"
}
},
{
"company": {
"id": 2,
"name": "Example Co",
"created_at": "2015-10-11T17:18:22.675Z",
"updated_at": "2016-09-15T02:55:46.708Z",
"embedded_key": "6e1a3c121f83dad4c0bef78414b9e597",
"per_number": "1.0",
"use_global_suppression_list": true,
"balance": "100.0",
"owner_user_name": "Charlie Smith"
}
}
]
```
--------------------------------
### Create a Reservation with URL Parameters
Source: https://retreaver.github.io/core-api-docs
This method creates a reservation by passing data as URL parameters. It checks for availability and bidding, then stores the reservation for a limited time.
```bash
curl -X POST "https://rtb.retreaver.com/rtbs.json?" \
-d "key=7fc40342-f0a0-4e8f-bf09-b3887eedcb41" \
-d "publisher_id=retreaver_pub" \
-d "caller_number=+18558485518"
```
--------------------------------
### Create a Reservation with JSON Body
Source: https://retreaver.github.io/core-api-docs
This method creates a reservation by passing data as a JSON body. It checks for availability and bidding, then stores the reservation for a limited time.
```bash
curl -X POST "https://rtb.retreaver.com/rtbs.json" \
-d
'{
"key": "7fc40342-f0a0-4e8f-bf09-b3887eedcb41",
"publisher_id": "retreaver_pub",
"caller_number": "+18558485518"
}'
```
--------------------------------
### Get Contacts Response Example
Source: https://retreaver.github.io/core-api-docs
The API returns a JSON array of contact objects, each containing contact numbers and tags.
```json
[{
"contact": {
"id": 2,
"contact_numbers": [
{
"number": "+18668987878",
"description": "Landline",
"id": 2
}
],
"tag_values": [
{
"key": "name",
"value": "Retreaver Support",
"operator": "==",
"id": 154060720
}
]
}
}]
```
--------------------------------
### Create a Target
Source: https://retreaver.github.io/core-api-docs
Use this command to create a new target. Ensure you replace placeholder values with your actual API key, company ID, and target details.
```bash
curl -s \
-X POST \
https://api.retreaver.com/targets.json?api_key=woofwoofwoof&company_id=1 \
-H "Content-Type: application/json" \
-d '{"target":{"number":"+18668987878", "name":"Retreaver Support"}}'
```
--------------------------------
### Number Pool JSON Response Example
Source: https://retreaver.github.io/core-api-docs
Example structure of the JSON response when retrieving number pools.
```json
[{
"number_pool": {
"id": 1,
"numbers_count": 0,
"type": "Toll-free",
"country": "CA",
"max_pool_size": 10,
"buffer_seconds": 0,
"updated_at": "2013-04-25T16:16:51Z",
"created_at": "2013-04-25T16:16:51Z",
"google_analytics": false,
"hide_embedded_access": false,
"afid": "0001",
"cid": "111",
"reserve_size": 1
}
}]
```
--------------------------------
### Create an Affiliate
Source: https://retreaver.github.io/core-api-docs
Creates a new affiliate with provided details. Requires company ID and API key. The request body must be JSON.
```bash
curl -s \
-X POST \
https://api.retreaver.com/api/v1/affiliates.json?api_key=woofwoofwoof&company_id=1 \
-H "Content-Type: application/json" \
-d '{"affiliate":{"first_name":"Nancy", "last_name":"Drew", "afid":"0002"}}'
```
```json
{"affiliate":{"first_name":"Nancy", "last_name":"Drew", "afid":"0002"}}
```
--------------------------------
### Campaign Creation Response
Source: https://retreaver.github.io/core-api-docs
This is an example of the JSON response received after successfully creating a campaign. It includes details of the created campaign, such as its ID, name, and associated timers and menu options.
```json
{
"campaign":{
"cid":"0044",
"name":"MyCampaign",
"updated_at":"2012-07-15T03:34:00Z",
"created_at":"2012-07-15T03:34:00Z",
"record_calls":true,
"record_seconds":3600,
"dedupe_seconds":0,
"affiliate_can_pull_number":false,
"show_key":"5e2ba674a8a1fb34dddcf850139ffdd9",
"greeting":{
"message":"Thanks for calling, please press one to continue.",
"voice_gender":"Male"
},
"timers":[
{
"timer":{
"id":217,
"seconds":0,
"url":"http://callpixels.com/click.html"
}
},
{
"timer":{
"id":218,
"seconds":90,
"url":"http://callpixels.com/sale.html"
}
}
],
"menu_options":[
{
"menu_option":{
"id":77,
"option":"1",
"target_cid":null,
"target_number":"+16474570424"
}
}
]
}
}
```
--------------------------------
### Create a Company
Source: https://retreaver.github.io/core-api-docs
Use this command to create a new company. The request body must be JSON and include the company name. The API key should be appended to the URL.
```bash
curl -s \
-X POST \
https://api.retreaver.com/companies.json \
-H "Content-Type: application/json" \
-d '{"company":{"name":"Retreaver"}}'
```
```json
{
"company": {
"id": 1,
"name": "Retreaver",
"created_at": "2025-01-28T12:18:44.131Z",
"updated_at": "2025-01-28T12:18:44.131Z",
"embedded_key": "6e1a3c121f83dad4c0bef78414b9e597",
"per_number": "1.0",
"use_global_suppression_list": true,
"balance": "100.0",
"owner_user_name": "Alice Bob"
}
}
```
--------------------------------
### Target Caps Response Example
Source: https://retreaver.github.io/core-api-docs
This JSON structure illustrates the response received after updating a target's caps. It shows the target's details along with an array of current cap configurations, including their IDs, filled amounts, cap values, and types.
```json
{
"target": {
"id": 22592,
"number": "+18668987878",
"name": "Retreaver Support",
"caps": [
{
"id": 707900,
"filled": 0,
"cap": null,
"type": "Daily"
},
{
"id": 707898,
"filled": 0,
"cap": 100,
"type": "Hard"
},
{
"id": 707899,
"filled": 0,
"cap": null,
"type": "Hourly"
},
{
"id": 707901,
"filled": 0,
"cap": null,
"type": "Monthly"
}
]
}
}
```
--------------------------------
### Call Data Writing - GET
Source: https://retreaver.github.io/core-api-docs
Use GET requests to apply tags to calls by including parameters in the URL. This method is suitable for applying tags before or after a call is processed.
```APIDOC
## GET /data_writing/:postback_key_uuid
### Description
Applies tags to a call using GET parameters in the URL. Tags can be applied before or after a call is processed.
### Method
GET
### Endpoint
`https://retreaverdata.com/data_writing/:postback_key_uuid?caller_number=:caller_number&age=39&utm_campaign=auto`
### Parameters
#### Path Parameters
- **postback_key_uuid** (string) - Required - The UUID of the Postback Key used to authorize this change.
#### Query Parameters
- **caller_number** (string) - Optional - The caller number of the Call for which the tags should be applied. This or a call_uuid should be provided.
- **call_uuid** (string) - Optional - The uuid of the Call for which the tags should be applied. This or a caller_number should be provided.
- **:tag_key** (string) - Optional - Dynamic key:value pairs in the form of ‘?key1=value1&key2=value2’.
### Response
#### Success Response (200)
- **tag_values** (object) - Key-value pairs of applied tags.
- **call_uuid** (string) - The UUID of the call if found.
- **caller_number** (string) - The caller number if the call was not found and tags were stored.
- **status** (string) - Indicates the outcome, e.g., "completed call found, tags applied" or "call not found, tags stored".
#### Response Example
{
"tag_values": {
"age":"39",
"utm_campaign":"auto"
},
"call_uuid":"9b653cf0-4835-493b-860c-aed9b7af2a4a",
"status":"completed call found, tags applied"
}
{
"tag_values": {
"age":"39",
"utm_campaign":"auto"
},
"caller_number":"+3569878933094",
"status":"call not found, tags stored"
}
```
--------------------------------
### Get a specific Company
Source: https://retreaver.github.io/core-api-docs
Retrieves a specific Company based on its internal ID.
```APIDOC
## Get a specific Company - DEPRECATED
### Description
Returns the Company matching our internal ID.
### Method
GET
### Endpoint
https://api.retreaver.com/companies/{company_id}.json?api_key={api_key}
### Path Parameters
- **company_id** (integer) - Required - The internal ID of the company to retrieve.
### Query Parameters
- **api_key** (string) - Required - Your Retreaver API key.
### Response
#### Success Response (200)
- **company** (object) - Contains company details.
- **id** (integer) - The unique identifier for the company.
- **name** (string) - The name of the company.
- **default_click_url** (string) - The default click URL for the company.
- **default_sale_url** (string) - The default sale URL for the company.
- **created_at** (string) - The timestamp when the company was created.
- **updated_at** (string) - The timestamp when the company was last updated.
### Response Example
```json
{
"company": {
"id": 1,
"name": "CallPixels",
"default_click_url": "http://callpixels.com/?a=[affiliate_id]&c=[campaign_id]&cp=js&s1=[sub_id]",
"default_sale_url": "http://callpixels.com/p.ashx?o=[campaign_id]&t=[call_log_id]-[caller_id]-[called_number]-[call_duration]-[call_recording_url]",
"created_at": "2012-04-15T05:44:10Z",
"updated_at": "2012-05-07T15:32:44Z"
}
}
```
```
--------------------------------
### Get All Suppressed Numbers
Source: https://retreaver.github.io/core-api-docs
Retrieves information about all numbers currently suppressed for a company.
```APIDOC
## GET /suppressed_numbers.json
### Description
Get information about all of the numbers that are currently suppressed in a company.
### Method
GET
### Endpoint
`https://api.retreaver.com/suppressed_numbers.json`
### Parameters
#### Query Parameters
- **api_key** (string) - Required - Your API key.
- **company_id** (integer) - Required - The ID of the company.
### Response
#### Success Response (200)
- An array of suppressed number objects, each containing:
- **suppressed_number** (object)
- **id** (integer) - The unique identifier for the suppressed number entry.
- **number** (string) - The suppressed phone number.
- **created_at** (string) - The timestamp when the number was suppressed.
- **can_resubscribe** (boolean) - Indicates if the caller can resubscribe.
- **company_id** (integer) - The ID of the company.
- **cid** (integer) - The CID associated with the suppression.
### Response Example
```json
[
{
"suppressed_number": {
"id": 18996945,
"number": "+13213749611",
"created_at": "2024-09-30T21:09:54.769Z",
"can_resubscribe": true,
"company_id": 1,
"cid": 159
}
}
]
```
```
--------------------------------
### Create a Contact
Source: https://retreaver.github.io/core-api-docs
Use this command to create a new contact. You can specify tags and contact numbers in the request body. The response will contain the newly created contact's details.
```bash
curl -s \
-X POST \
https://api.retreaver.com/contacts.json \
-H "Content-Type: application/json" \
-d '{"contact":{"tag_list":"<<>>","contact_numbers_attributes":[{"number":"8668987878", "description":"Landline"}]}}'
```