### Create Static Caller Number Example Source: https://github.com/retreaver/core-api-docs/blob/master/source/index.html.md Example using curl to create a new static caller number. ```shell curl -s \ -X POST \ https://api.retreaver.com/static_caller_numbers.json?api_key=woofwoofwoof&company_id=1 \ -H "Content-Type: application/json" \ -d '{"static_caller_number":{"number":"+18668987878"}}' ``` -------------------------------- ### Get Static Caller Numbers Example Source: https://github.com/retreaver/core-api-docs/blob/master/source/index.html.md Example using curl to fetch all static caller numbers for a company. ```shell curl "https://api.retreaver.com/static_caller_numbers.json?api_key=woofwoofwoof&company_id=1" ``` -------------------------------- ### Tag Value Name Report Example Source: https://github.com/retreaver/core-api-docs/blob/master/source/includes/_reports.md Illustrates how to generate a report faceted by a specific tag name (e.g., 'utm_campaign') for call data. This example includes a cURL command and the corresponding JSON response structure, showing detailed metrics per tag. ```shell curl "https://api.retreaver.com/api/v1/reports.json?api_key=woofwoofwoof&company_id=1&facet=tag_value&domain=calls&created_at_start=2024-10-25&created_at_end=2024-10-28&tag_value_key=utm_campaign" ``` ```json { "count": 3, "count_total": 3, "data": [ { "id": "ret_campaign_123", "facet_name": "ret_campaign_123", "total_calls": 2, "repeat_count": 2.0, "duplicate_count": 0.0, "unique_calls": 1.0, "converted_count": 0.0, "revenue": 0.0, "payout": 0.0, "cost": 0.12, "total_duration": 3.666666666666667, "total_duration_percent": 0.4714045207910327, "rescued_count": 0.0, "rescued_revenue": 0.0, "connected_duration": 0.0, "connected_duration_percent": 0.0, "in_progress_count": 0.0, "profit": -0.12, "repeat_count_percent": 66.66666666666666, "duplicate_count_percent": 0, "converted_count_percent": 0, "rescued_count_percent": 0, "epc": 0, "cpc": 0 }, { "id": "ret_campaign_456", "facet_name": "ret_campaign_456", "total_calls": 1, "repeat_count": 0, "duplicate_count": 0.0, "unique_calls": 1.0, "converted_count": 0.0, "revenue": 0.0, "payout": 0.0, "cost": 0.12, "total_duration": 3.666666666666667, "total_duration_percent": 0.4714045207910327, "rescued_count": 0.0, "rescued_revenue": 0.0, "connected_duration": 0.0, "connected_duration_percent": 0.0, "in_progress_count": 0.0, "profit": -0.12, "repeat_count_percent": 66.66666666666666, "duplicate_count_percent": 0, "converted_count_percent": 0, "rescued_count_percent": 0, "epc": 0, "cpc": 0 } ] } ``` -------------------------------- ### Target Retrieval API Source: https://github.com/retreaver/core-api-docs/blob/master/source/index.html.md Provides endpoints for retrieving lists of targets and details for a specific target. Includes request methods, parameters, and example JSON responses. ```APIDOC Target Management: Get All Targets: Method: GET Endpoint: /targets.json Description: Retrieves a list of all targets associated with the company. Parameters: - api_key (query, string, required): Your Retreaver API key. - company_id (query, integer, required): The ID of the company. Example Request: curl "https://api.retreaver.com/targets.json?api_key=woofwoofwoof&company_id=1" Example Response: [ { "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" } } ] Get Specific Target: Method: GET Endpoint: /targets/{target_id}.json Description: Retrieves details for a single target identified by its ID. Parameters: - target_id (path, integer, required): The unique identifier of the target to retrieve. - api_key (query, string, required): Your Retreaver API key. - company_id (query, integer, required): The ID of the company. Example Request: curl "https://api.retreaver.com/targets/6588.json?api_key=woofwoofwoof&company_id=1" Example Response: { "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" } } ``` -------------------------------- ### Enumerate Retreaver API V2 Calls (Pagination) Source: https://github.com/retreaver/core-api-docs/blob/master/source/index.html.md Demonstrates how to paginate through all calls using the Retreaver API V2. It shows example `curl` commands for fetching calls page by page, recommending the use of `sort_by` and `order` parameters for consistent retrieval. ```shell curl "https://api.retreaver.com/api/v2/calls.json?api_key=woofwoofwoof&page=1" curl "https://api.retreaver.com/api/v2/calls.json?api_key=woofwoofwoof&page=2" # Example with sorting and company filter curl "https://api.retreaver.com/api/v2/calls.json?api_key=woofwoofwoof&company_id=1&sort_by=created_at&order=asc&page=1" curl "https://api.retreaver.com/api/v2/calls.json?api_key=woofwoofwoof&company_id=1&sort_by=created_at&order=asc&page=2" ``` -------------------------------- ### Get All Campaigns Source: https://github.com/retreaver/core-api-docs/blob/master/source/index.html.md Retrieves a list of all campaigns configured within your Retreaver account. The response is a JSON array containing campaign details. ```shell curl "https://api.retreaver.com/campaigns.json?api_key=woofwoofwoof&company_id=1" ``` ```APIDOC GET /campaigns.json Description: Lists all campaigns in the account. Parameters: - api_key: string (required) - Your Retreaver API key. - company_id: string (required) - The ID of the company. Returns: - JSON array of campaign objects. Example Response Structure: [ { "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]" } } ], "menu_options": [ { "menu_option": { "id": 61, "option": "1", "target_cid": null, "target_number": "+18987748833" } } ] } } ] ``` -------------------------------- ### Get All Companies Source: https://github.com/retreaver/core-api-docs/blob/master/source/index.html.md Retrieves a complete list of companies accessible via your account. Requires an API key for authentication. The response is a JSON array of company objects. ```shell 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" } } ] ``` ```APIDOC GET https://api.retreaver.com/companies.json?api_key=woofwoofwoof --- **Description:** Provides a complete list of Companies accessible via your Account. **Parameters:** - `api_key` (string, required): Your Retreaver API key. **Returns:** A JSON array of company objects, each containing details like id, name, timestamps, balance, etc. ``` -------------------------------- ### API Pagination Information Source: https://github.com/retreaver/core-api-docs/blob/master/source/index.html.md Explains Retreaver's RESTful pagination strategy, which returns 25 results per page. It details how to interpret the `Link` HTTP header to navigate through pages, providing an example of the header format. ```APIDOC Retreaver is a RESTful paginated API that returns 25 results per page. Each relevant index response will have a [Link HTTP header](https://www.w3.org/wiki/LinkHeader) present. Example Link Header: `Link: ; rel="last", ; rel="next"` By parsing the Link header, you can determine the last, next, and previous pages. ``` -------------------------------- ### Tag Value Report Example Source: https://github.com/retreaver/core-api-docs/blob/master/source/includes/_reports.md Demonstrates how to generate a report faceted by 'tag_value' for call data within a specified date range. Includes a cURL command for execution and the expected JSON response structure. ```shell curl "https://api.retreaver.com/api/v1/reports.json?api_key=woofwoofwoof&company_id=1&facet=tag_value&domain=calls&created_at_start=2024-10-25&created_at_end=2024-10-28" ``` ```json { "count": 3, "count_total": 3, "data": [ { "id": "utm_campaign", "facet_name": "utm_campaign", "total_calls": 3, "repeat_count": 2.0, "duplicate_count": 0.0, "unique_calls": 1.0, "converted_count": 0.0, "revenue": 0.0, "payout": 0.0, "cost": 0.12, "total_duration": 3.666666666666667, "total_duration_percent": 0.4714045207910327, "rescued_count": 0.0, "rescued_revenue": 0.0, "connected_duration": 0.0, "connected_duration_percent": 0.0, "in_progress_count": 0.0, "profit": -0.12, "repeat_count_percent": 66.66666666666666, "duplicate_count_percent": 0, "converted_count_percent": 0, "rescued_count_percent": 0, "epc": 0, "cpc": 0 } ] } ``` -------------------------------- ### Get all Numbers using cURL Source: https://github.com/retreaver/core-api-docs/blob/master/source/index.html.md This cURL command retrieves a list of all numbers associated with your account. It requires your API key and company ID for authentication. ```shell curl "https://api.retreaver.com/numbers.json?api_key=woofwoofwoof&company_id=1" ``` -------------------------------- ### Example JSON Response Structure Source: https://github.com/retreaver/core-api-docs/blob/master/source/includes/_reports.md This shows the typical JSON structure returned by the Retreaver API for report queries. It includes counts and a data array, which may be empty if no matching records are found. ```json { "count": 0, "count_total": 0, "data": [] } ``` -------------------------------- ### Call Object Structure - JSON Source: https://github.com/retreaver/core-api-docs/blob/master/source/index.html.md Provides an example of the JSON structure returned when fetching details for a specific call. It includes various attributes such as caller information, call duration, 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" } } ``` -------------------------------- ### Get Specific Call Details - Shell Source: https://github.com/retreaver/core-api-docs/blob/master/source/index.html.md Illustrates how to retrieve detailed information for a single call by specifying its unique identifier (UUID) in the URL path. Requires API key and company ID for authentication. ```shell curl "https://api.retreaver.com/calls/addcf985-017e-4962-be34-cf5d55e74afc.json?api_key=woofwoofwoof&company_id=1" ``` -------------------------------- ### Enumerate Retreaver API V2 Calls by Date Range Source: https://github.com/retreaver/core-api-docs/blob/master/source/index.html.md Illustrates how to retrieve calls within a specific date and time range using the Retreaver API V2. It provides `curl` examples with `created_at_start` and `created_at_end` parameters, emphasizing the RFC3339 timestamp format. ```shell curl "https://api.retreaver.com/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 using the documented GET request format 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 ``` -------------------------------- ### Retreaver Call Data Writing API Source: https://github.com/retreaver/core-api-docs/blob/master/source/index.html.md Allows users to apply tags to inbound callers using call data writing. Supports both GET and POST requests to retreaverdata.com. Tags can be applied before, during, or after a call, with options to store tags if the call is not immediately found. ```APIDOC HTTP Request: POST/GET https://retreaverdata.com/data_writing Parameters: - key (string, Required): The UUID of the Postback Key used to authorize this change. - caller_number (string, Optional): The caller number for which tags should be applied. This or call_uuid must be provided. - call_uuid (string, Optional): The UUID of the Call for which tags should be applied. This or caller_number must be provided. - :tag_key (string, Optional): Dynamic key:value pairs in the form of '?key1=value1&key2=value2'. GET Example: curl "https://reteaverdata.com/data_writing/:postback_key_uuid?caller_number=:caller_number&age=39&utm_campaign=auto" POST Example: 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" }' Response Example (call_uuid): { "tag_values": { "age":"39", "utm_campaign":"auto" }, "call_uuid":"9b653cf0-4835-493b-860c-aed9b7af2a4a", "status":"completed call found, tags applied" } Response Example (caller_number): { "tag_values": { "age":"39", "utm_campaign":"auto" }, "caller_number":"+3569878933094", "status":"call not found, tags stored" } ``` -------------------------------- ### Place Bid with Query Parameters (Tagging) Source: https://github.com/retreaver/core-api-docs/blob/master/source/includes/_rtb.md Demonstrates how to place a bid request using query parameters, including custom tags like zip code and age. It shows the curl command and the expected JSON response. ```shell curl -X POST "https://rtb.retreaver.com/rtbs.json?key=7fc40342-f0a0-4e8f-bf09-b3887eedcb4a&publisher_id=retreaver_pub&caller_number=+18558485518&caller_zip=12344&age=25" ``` ```json { "uuid": "c6e4ce37-9b49-46af-bd8e-16cb7753499d", "status": "reserved", "retreaver_payout": 5.0, "retreaver_seconds": 10, "inbound_number": "+18772435010", "expires_at": "2024-10-28T12:08:49.880Z" } ``` -------------------------------- ### Create Campaign using cURL Source: https://github.com/retreaver/core-api-docs/blob/master/source/index.html.md Demonstrates how to create a new campaign by sending a POST request to the Retreaver API. It includes the necessary headers and a JSON payload with campaign details. ```shell curl -s \ -X POST \ https://api.retreaver.com/campaigns.json \ -H "Content-Type: application/json" \ -d '{ \ "campaign": { \ "cid": "000333", \ "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" \ } \ ] \ } \ }' \ ``` -------------------------------- ### Delete Static Caller Number Example Source: https://github.com/retreaver/core-api-docs/blob/master/source/index.html.md Example using curl to delete a specific static caller number by its ID. ```shell curl -X DELETE https://api.retreaver.com/static_caller_numbers/1234.json?api_key=woofwoofwoof&company_id=1 ``` -------------------------------- ### Campaign Configuration Parameters Source: https://github.com/retreaver/core-api-docs/blob/master/source/index.html.md Defines the parameters for configuring a campaign, including core identifiers, messaging options, call routing logic via timers and menu options, and affiliate settings. This schema is used for creating or updating campaign resources. ```APIDOC CampaignConfiguration: cid: string description: Your internal campaign ID that will be referenced in the future. default: Random 8 characters name: string description: A name for the campaign for your reference. dedupe_seconds: integer description: Prevent a repeat caller from causing any Connect (timer.seconds == 0) or Sale (timer.seconds > 0) timer from firing within n seconds. Does not affect < 0 second timers. default: 0 (Disabled) affiliate_can_pull_number: boolean description: Allow affiliates to access this campaign via our LinkTrust integration. default: false record_calls: boolean description: Toggles call recording on and off. default: true message: string description: *Text-to-speech* A message you want read aloud to the caller when they dial your number. Make sure to tell them to press one to continue. voice_gender: string description: *Text-to-speech* Male or Female, the gender of the text-to-speech voice you want. default: Male message_file: file description: *Audio File* An audio file you would like played for the caller when they dial your number. Use this field with multipart/form-data submissions. message_file_b64_data: string description: *Audio File* A Base64-encoded audio file. Only use this field if you're not using the message_file field. message_file_b64_filename: string description: *Audio File* The original file name for the Base64-encoded audio file. Something like 'memo.flac'. We suggest using the highest quality audio available. repeat: integer description: The number of times to repeat the greeting. default: 4 timers_attributes: array of Timer description: An array of timers. menu_option_attributes: array of MenuOption description: An array of menu options. destroy_nested: boolean description: When set, causes existing timers and menu_options to be destroyed. Existing timers and menu options can be updated by including their unique ID. Alternatively, you can simply remove all the existing timers and menu options by setting this to true and resubmit all the values. default: false --- Nested Attribute: Timer seconds: integer description: The minimum length of time the call must last for this pixel to be fired. If set to 0, the pixel will fire at the beginning of the call, much like a click. required: true url: string description: The URL that should be called for this timer. The URL does not have to be a pixel, and will be passed any cookies that were set on the 0-second timer. Our bot follows redirects intelligently. required: true --- Nested Attribute: MenuOption option: string description: The button the caller will press. The default menu option for a campaign is the one for button press '1', so if you aren't using an IVR and want the call to forward instantly, set the option to '1'. (1 2 3 4 5 6 7 8 9 0 * #) required: true target_number: string description: A phone number to redirect the caller to. All > 0 second timers will start when the call is answered. target_cid: string description: A campaign ID to redirect the caller to. The campaign must be configured in the system. If this value is set, it will override the target number. This option can be used to allow the caller to replay the greeting. ``` -------------------------------- ### Call Configuration Optional Parameters Source: https://github.com/retreaver/core-api-docs/blob/master/source/index.html.md Defines optional parameters that can be used to customize call behavior, such as playing audio messages, setting up timers, and configuring menu options. These parameters can override campaign-level settings. ```APIDOC Optional Parameters for Call Configuration: - `message` (string): Text-to-speech message to be read aloud to the caller. - `voice_gender` (string): Gender of the text-to-speech voice ('Male' or 'Female'). Defaults to 'Male'. - `message_file` (file): An audio file to be played for the caller. Use with multipart/form-data. - `message_file_b64_data` (string): Base64-encoded audio file. Use only if `message_file` is not used. - `message_file_b64_filename` (string): Original filename for the Base64-encoded audio file (e.g., 'memo.flac'). - `repeat` (integer): The number of times the greeting should be repeated. Defaults to 4. - `timers_attributes` (array): An array of Timer objects to override campaign timer settings. - `menu_options_attributes` (array): An array of Menu Option objects to override campaign menu settings. Nested Attribute: Timer Used within `timers_attributes` to define specific timing events during a call. - `seconds` (integer, required): Minimum call duration in seconds for the timer to fire. If 0, fires at call start. - `url` (string, required): The URL to be called when the timer condition is met. The system follows redirects. Nested Attribute: Menu Option Used within `menu_options_attributes` to configure interactive voice response (IVR) options. - `option` (string, required): The button pressed by the caller (e.g., '1', '2', '*', '#'). - `target_number` (string): A phone number to redirect the caller to. Timers start upon answer. - `target_cid` (string): A campaign ID to redirect the caller to. Overrides `target_number`. Can be used to replay greetings. ``` -------------------------------- ### Get All Contacts Source: https://github.com/retreaver/core-api-docs/blob/master/source/index.html.md Retrieves a list of contacts associated with a specific company. Contacts can be tagged, and calls from their associated numbers will inherit these tags. Requires company_id as a query parameter. ```shell curl "https://api.retreaver.com/contacts.json?api_key=woofwoofwoof&company_id=1" ``` ```json [ { "contact": { "id": 2, "contact_numbers": [ { "number": "+18668987878", "description": "Landline", "id": 2 } ], "tag_values": [ { "key": "name", "value": "Retreaver Support", "operator": "==", "id": 154060720 } ] } } ] ``` ```APIDOC GET https://api.retreaver.com/contacts.json?api_key=woofwoofwoof&company_id={company_id} **Parameters:** - `api_key` (string, required): Your Retreaver API key. - `company_id` (integer, required): The ID of the company to retrieve contacts for. **Returns:** A JSON array of contact objects. Each contact object includes its ID, associated contact numbers, and tag values. ``` -------------------------------- ### Get Company Information Source: https://github.com/retreaver/core-api-docs/blob/master/source/index.html.md Retrieves details for either the currently active company or a specific company by its ID. This is useful for managing account-level settings and identifying the active context. ```APIDOC GET https://api.retreaver.com/company.json GET https://api.retreaver.com/companies/{id}.json Parameters: - api_key: string (required) - Your Retreaver API key. - company_id: integer (optional) - For GET /company.json, specifies which company to act on if not the default. For GET /companies/{id}.json, this is the ID of the company to retrieve. Response Example (for both endpoints): { "company": { "id": 1, "name": "Retreaver", "created_at": "2012-04-17T22:58:17.000Z", "updated_at": "2024-12-19T11:00:37.896Z", "embedded_key": "6e1a3c121f83dad4c0bef78414b9e597", "per_number": "1.0", "use_global_suppression_list": true, "balance": "100.0", "owner_user_name": "Alice Bob" } } Notes: - When using the web interface, the active company can change. Always pass `company_id` when requesting other objects to ensure you are targeting the correct company. - The `GET /company.json` endpoint retrieves the currently active company context. ``` ```shell curl "https://api.retreaver.com/company.json?api_key=woofwoofwoof" curl "https://api.retreaver.com/companies/1.json?api_key=woofwoofwoof" ``` ```json { "company": { "id": 1, "name": "Retreaver", "created_at": "2012-04-17T22:58:17.000Z", "updated_at": "2024-12-19T11:00:37.896Z", "embedded_key": "6e1a3c121f83dad4c0bef78414b9e597", "per_number": "1.0", "use_global_suppression_list": true, "balance": "100.0", "owner_user_name": "Alice Bob" } } ``` -------------------------------- ### Get Specific Campaign Source: https://github.com/retreaver/core-api-docs/blob/master/source/index.html.md Retrieves details for a single campaign identified by its unique campaign ID (cid). The response is a JSON object containing the campaign's configuration. ```shell curl "https://api.retreaver.com/campaigns/cid/0044.json?api_key=woofwoofwoof&company_id=1" ``` ```APIDOC GET /campaigns/cid/{campaign_id}.json Description: Retrieves a specific campaign by its ID. Parameters: - api_key: string (required) - Your Retreaver API key. - company_id: string (required) - The ID of the company. - campaign_id: string (path parameter) - The unique ID (cid) of the campaign to retrieve. Returns: - JSON object representing the campaign. Example Response Structure: { "campaign": { "cid": "0044", "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]" } } ], "menu_options": [ { "menu_option": { "id": 61, "option": "1", "target_cid": null, "target_number": "+18987748833" } } ] } } ``` -------------------------------- ### Affiliate Management API Source: https://github.com/retreaver/core-api-docs/blob/master/source/index.html.md Provides endpoints for creating, updating, and deleting affiliate records. Includes details on request methods, parameters, and expected responses. ```APIDOC Affiliate Management: Create Affiliate: Method: POST Endpoint: /affiliates.json Description: Creates a new affiliate record. Parameters: - api_key (query, string, required): Your Retreaver API key. - company_id (query, integer, required): The ID of the company. - affiliate (body, object, required): An object containing affiliate details. - afid (string, required): The affiliate's ID, aligning with external tracking systems. - first_name (string, optional): The affiliate's first name. - last_name (string, optional): The affiliate's last name. - company_name (string, optional): The affiliate's company name. Example Request: curl -s \ -X POST \ https://api.retreaver.com/affiliates.json?api_key=woofwoofwoof&company_id=1 \ -H "Content-Type: application/json" \ -d '{"affiliate":{"first_name":"Nancy", "last_name":"Drew", "afid":"0002"}}' Update Affiliate: Method: PUT Endpoint: /affiliates/afid/{afid}.json Description: Updates an existing affiliate's attributes. Parameters: - afid (path, string, required): The unique identifier of the affiliate to update. - api_key (query, string, required): Your Retreaver API key. - company_id (query, integer, required): The ID of the company. - affiliate (body, object, required): An object containing the attributes to update. - first_name (string, optional): The affiliate's first name. - last_name (string, optional): The affiliate's last name. - company_name (string, optional): The affiliate's company name. Example Request: curl -s \ -X PUT \ https://api.retreaver.com/affiliates/afid/0002.json?api_key=woofwoofwoof&company_id=1 \ -H "Content-Type: application/json" \ -d '{"affiliate":{"first_name":"Nathan"}}' Example Response: { "affiliate": { "afid": "002", "first_name": "Nathan", "last_name": "Drew", "company_name": null, "updated_at": "2012-05-03T20:20:03Z", "created_at": "2012-05-03T14:29:37Z" } } Delete Affiliate: Method: DELETE Endpoint: /affiliates/afid/{afid}.json Description: Deletes a specific affiliate. Ensure all associated numbers are deleted first. Parameters: - afid (path, string, required): The unique identifier of the affiliate to delete. - api_key (query, string, required): Your Retreaver API key. - company_id (query, integer, required): The ID of the company. Example Request: curl -X DELETE https://api.retreaver.com/affiliates/afid/0002.json?api_key=woofwoofwoof&company_id=1 ``` -------------------------------- ### Get Specific Target Group (Shell) Source: https://github.com/retreaver/core-api-docs/blob/master/source/includes/_target_groups.md Retrieves details for a single target group identified by its ID. This operation requires an API key and company ID. ```shell curl "https://api.retreaver.com/target_groups/1.json?api_key=woofwoofwoof&company_id=1" ``` -------------------------------- ### RTB API Endpoint and Parameters Source: https://github.com/retreaver/core-api-docs/blob/master/source/includes/_rtb.md Details the primary RTB API endpoint for placing bids. It outlines mandatory and optional query parameters, their types, and descriptions, along with the expected JSON response structure. ```APIDOC POST https://rtb.retreaver.com/rtbs.json -- Query Parameters -- Parameter | Mandatory | Description --------- | ------- | ----------- key | Yes | Postback key, found on the campaign page where the Real Time Bidding Postback Key is issued. publisher_id/source_id | Yes | The Source/Affiliate/Publisher this bid is going to be attributed to. caller_number | Yes | The caller number. inbound_number | No | If provided the `rtb` will expect the caller to call this number. If not provided the `rtb` will return a temporary number. tags | No | Providing additional query parameters will result in tagging the `rtb` with those additional values. Please view the examples below. -- Request Body Parameters -- Parameters can also be sent via a JSON request body. -- Response Structure -- { "uuid": "string", "status": "string", "retreaver_payout": "number", "retreaver_seconds": "integer", "inbound_number": "string", "expires_at": "string" } ``` -------------------------------- ### Campaign Creation Response Source: https://github.com/retreaver/core-api-docs/blob/master/source/index.html.md Illustrates the JSON structure returned by the Retreaver API upon successful creation of a campaign. It details the campaign's attributes, including its ID, name, greeting, 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" } } ] } } ``` -------------------------------- ### Get All Target Groups (Shell) Source: https://github.com/retreaver/core-api-docs/blob/master/source/includes/_target_groups.md Retrieves a list of all target groups within a company. This command requires an API key and company ID for authentication and scope. ```shell curl "https://api.retreaver.com/target_groups.json?api_key=woofwoofwoof&company_id=1" ```