API Agency Management
If you'd like to upgrade your plan, contact support@woodpecker.co.
Agency
In this help entry, we will try to clarify REST API’s usage in the management of the Agency Account.
With our Agency API you can:
- browse through the basic information, like running campaigns, company IDs or their API keys;
- generate new API keys based on just company ID number;
- Add / edit prospects on a global list
- or even add a whole new company of a new API key simply by defining its new name.
AGENCY/COMPANIES
List of API keys
GET /rest/v1/agency/companies
Sample response
[{ "id": 2125556342, "name": "Aviato", "campaigns": 0, "owner": "Erlich Bachman", "api_keys": [{ "api_key": "18bd0a013d360ed3ea8a5d529bf4c98e", "name": "md5" }] }, { "id": 391891372, "name": "Bachmanity", "campaigns": 17, "owner": "Erlich Bachman", "api_keys": [{ "api_key":"CD9316D89B0B2405917292F1565F537803AF4867", "name": "sha1" }, { "api_key": "439a55ddf21ba3a3ed67fafa0552c578", "name": "md52" } ] } ]
Description of parameters
URL | Value type | Description |
id | num | Company ID number |
name | string | Company name |
campaigns | num | Number of active/ running campaigns |
owner | string | Owner full name |
api_keys | Nested JSON | Detailed stats section |
api_key | Credential | Unique code which often constitutes both an identifier and a secret token as a form of authentication |
name | string | Individual key name |
AGENCY/COMPANIES/API/ADD
This endpoint lets you create API keys through REST API with just a simple command. You can skip entering a website for each company and just use their ID numbers and label this new key. Newly created keys can be found by using a command from the above list.
Creating an API Key
POST rest/v1/agency/companies/api/add
{ "company_id" : num, "name" : "key’s label" }
Sample request
{ "company_id" : 11111111, "name" : key's label }
Sample response
{ "api_key" : "generated_api_key" }
Description of parameters
company_id | num | ID of a company you want to generate the key in |
name | string | Description of the words which will be attached to the key |
api_key | api_key | Unique code which often constitutes both an identifier and a secret token as a form of authentication |
AGENCY/COMPANIES/ADD
Description of parameters
A correct request will create a company and generate an API key with a given name.
POST /rest/v1/agency/companies/add { "name": "Bachmanity Infinite" }
Sample response
{ "id": 1111119, "name": "Bachmanity Infinite", "campaigns": 0, "owner": "Erlich Bachman", "api_keys": [{ "api_key": "newly_generated_api_key", "name": "Bachmanity Infinite" }] }