Generate, check and validate codes

About CodeChecker

CodeChecker is an online service that can be used to generate and check large amounts of random codes. CodeChecker offers a dedicated platform for your promotional activities.

Each client receives a dedicated copy of the service, with its own API location. Please refer to the documentation you received to find your own API location and your own API keys.

For demonstration purposes you can use our demo API. The contents of the demo API will be reset regularly.

https://demo.codechecker.io/v1.3/

Campaigns and codes

This chapter explains the basic structure of your CodeChecker account, in particular the relation between campaigns and codes.

Campaigns

Campaigns define what you will use your codes for, when they are valid, and what the codes should look like. The campaign defines all configuration for the codes - the length, syntax, which charactersets to use, which characters to exclude. Before you can generate codes, you will need to define at least one campaign, but you can create as many campaigns as you need.

Usually you can use one campaign for you promotion, which holds all codes. But sometimes you need to create different sets for different products. You can create multiple campaigns, which all have a slightly different syntax for the codes. For example you could create 3 campaigns, where the codes for the first campaign start with "A", the second with "B" and the third with "C".

Because the campaign defines the configuration for the codes, you can easliy add new codes to an existing campaign, which will all be unique from the already existing codes.

Codes

All codes in your account (across all campaigns) are unique.

All codes are stored with a campaign to which they belong. Since the campaign defined the configuration of the code, it is not possible to create a code that is not associated with a campaign.

A code inherits some properties from the campaign it belongs to, like the date in which it it valid. A campaign can have a start- and end date, when a campaign expires all codes in that campaign will no longer be valid.

A code can be "used" as many times as is defined in the campaign. When a code is used the maximum number of times it is "spent" and can not be used again.

Generating codes

Codes can be configured in two ways, using different charactersets or using a pattern. This configuration is stored in the associated campaign. You can generate as many codes as you need, as long as it does not exceed the number of possible combinations for this configuration.

For example, if you generate codes of 4 digits (1234, 9876, etc.), there are only 10,000 possible combinations. Since all codes are unique you cannot create duplicates, so can never generate more than 10,000 codes.

You could for example generate 9,000 codes (out of 10,000 possible codes), but in that case you are using 9 out of 10 possible codes. Depening on your use case this could be a problem, because a valid code can very easily be guessed. Our advice for promotional activities is that this must be at least 1 in 10,000.

Please refer to our Code Creation Guidelines and Promotion Checklist for more information.

Generate using characterset

When using charactersets you define the length of the codes (for example 8 positions) and which charactersets to use - uppercase letters, lowercase letters, digits, etc.

Generate using pattern

When using a pattern you define the pattern of the codes (for example XXX-999), in which each character corresponds to a characterset that goes in that position in the generated codes. In this example it will be 3 uppercase letters, followed by a dash, followed by 3 digits.

- Uppercase - Lowercase - Digits - Special characters - Punctuation - Brackets - Space - Extra characters (as defined by you) X = Uppercase (A, B, C, ...) x = Lowercase (a, b, c, ...) 9 = Digits (0, 1, 2, ...) A = Uppercase + Digits (A, B, .. + 0, 1 ..) a = Lowercase + Digits (a, b, .. + 0, 1 ..) # = Special characters ($, %, &, ...) ! = Punctuation (!, ?, ...) [ = Brackets ([, ], (, ...) v = Vowels (a, e, i, ...) c = Consonants (b, c, d, ...) ? = Random from all characters above / = Escape character All other characters are used as literals. Characters following the escape character (ie. /X) will be used as a literal.

Official libraries

The libaries enable you to communicate with the API in a readable and easy to understand way. The CRUD keywords Create Read Update Delete are used as the primary way to execute commands. Those keywords are repeated throughout this documentation as well.

The keyword functions take either a string as input (the endpoint), or an array which contains the endpoint and an (optional) data array.

Download libraries

Libraries for the CodeChecker API are available in several languages.

PHP
Javascript (no jQuery required)

// Make call $result = $cc_api->read('codes/ABC123'); // Make call $result = $cc_api->read(array(   'endpoint' => 'codes/ABC123',   'data' => $data ));

Content Delivery Network

Instead of downloading the (Javascript) libraries to include in your project you can also use the online version of the library in our world-wide Content Delivery Network (CDN).

Our CDN uses 93 locations worldwide to deliver your content quickly to your visitors. Content which is requested multiple times within the same geographical region, is saved on a fast server in that particular region. This makes your tatic content quickly available to your visitors.

https://cdn.codechecker.io/js/codechecker-api-1.3.min.js

Example websites

We currently have one example website, for an promotion type of "Check your code and enter your data". This example is build in HTML and (jQuery) javascript.

This is a very simple website which demonstrates some pages to enter your unique code, which is validated against the front-end API. If the code is valid, you get a page to enter some personal data (name and email address). If this succeeds, your data is stored and the code is marked as used.

Download example website

Example website

https://examples.codechecker.io/enter-v1.3/

API keys

After creating an account (coming soon) you receive two unique API keys. These keys are your passwords to access the API. One is a front-end key that you can use in your applications, the other is an back-end key that you should only use when you execute back-end calls.

You can create as many API keys in your account as you wish. This can be useful if you manage multiple applications that use CodeChecker, simply give each application its own API key.

Security

Each API key has two ways of authorisation, to prevent unauthorised use. For client-side (Javascript) calls the API key can be associated with a domain, from which requests will be allowed (CORS - Cross Origin Resource Sharing). This is required for back-end keys, but not for front-end keys.

Since the API key is public it can be retrieved and used in a server side call, which cannot use CORS to check the origin of the request. Each API key also has an API secret, which is used for server side calls. This is required for all keys.

When you suspect your API key has been compromised, you can simply create a new key and delete the compromised key.

frontend-api-key backend-api-key backend-api-secret

API Request - Front-end

An API Request is made towards the endpoint you want to use. Depending on the endpoint you can add additional options in the request. The options are explained with each endpoint.

For example, if you want to check if the code ABC123 exists, use our API location https://demo.codechecker.io/v1.3/, followed by the endpoint codes/ followed by the code ABC123.

To authenticate, send your API key in the HTTP header.

https://demo.codechecker.io/v1.3/codes/ABC123 X-API-Key: frontend-api-key // Init codeChecker API $cc_api = new codeChecker\API\Connector() // Set API key $cc_api->setAPIurl('https://demo.codechecker.io/v1.3/'); $cc_api->setAPIkey('frontend-api-key'); // Make call $result = $cc_api->read('codes/ABC123');

API Request - Back-end

An API Request is made towards the endpoint you want to use. Depending on the endpoint you can add additional options in the request. The options are explained with each endpoint.

For example, if you want to get a list of available codes, use our API location https://demo.codechecker.io/v1.3/, followed by the endpoint admin/codes/.

Client-side authorisation

To authenticate, send your API key in the HTTP header. Make sure the domain you are making the call from is associated with this API key.

Server-side authorisation

To authenticate, send your API key and API secret in the HTTP header.

More information

For more information about authorisation, see the chapter about API keys

https://demo.codechecker.io/v1.3/codes/ABC123 X-API-Key: backend-api-key X-API-Secret: backend-api-secret // Init codeChecker API $cc_api = new codeChecker\API\Connector() // Set API key $cc_api->setAPIurl('https://demo.codechecker.io/v1.3/'); $cc_api->setAPIkey('backend-api-key'); $cc_api->setAPIsecret('backend-api-secret'); // Make call $result = $cc_api->read('admin/codes');

API Response

An API Response is returned with a HTTP status code indicating if the request has succeeded and if not, for what reason it failed. The response itself is formatted as a JSON string.

Please note that a successfully executed call for a code that is not found returns a HTTP 200 OK message with an empty result, instead of a HTTP 404 NOT FOUND message.

The most important value is the result, this indicated whether the code was found "result": true or not found "result": false.

When a check has failed an additional variable "error" is returned, indication the reason why the call has failed.

HTTP/1.1 200 OK Content-Length: 407 Content-Type: application/json { "result": true, "code": "ABC123", "data": {   "id": "1",   "campaign_id": "1",   "code": "ABC123",   "usage_count": "0",   "usage_maximum": "1",   "created": "2017-01-01 00:00:00",   "updated": "2017-01-01 00:00:00",   "valid_from": null,   "valid_to": null  } }

HTTPS encryption

The CodeChecker API can exclusively be accessed over an encrypted HTTPS connection. This ensures a secure connection for all data that is transmitted to and from the CodeChecker API.

HTTP Status codes

Each response from the API has the correct HTTP status code.

Possible HTTP status codes

  • 200 OK Request successfully completed, the message body contains the JSON response.
  • 400 Bad Request Request cannot be completed, required information is missing.
  • 401 Unauthenticated Request is not made from an associated domain, or the API key is incorrect.
  • 403 Forbidden< Request is made without an API key.
  • 404 Not Found Request is made towards a not-existing endpoint.

Please note that when a call is successfully executed, but no data was found, a HTTP 200 OK header is returned. Please use the "result" variable to check if any data was found.

Error messages

Error messages are returned in the JSON body of the response. This can for example happen when a call succeeds, but the requested code could not be found.

Common error messages

  • not-found
  • no-data
  • not-valid
  • already-used

The exact error messages are explained with each call.

{ "result": false, "code": "ABC123", "error": "not-found" }

Front-end endpoints

There is only a limited number of front-end endpoints, for the most basic of functions. Front-end endpoints can be used in any application that needs to check and use codes, or to add data to an existing code.

Front-end endpoints can be accessed with both front-end and back-end API keys. You should never use an back-end API key when it is not neccessary.

https://demo.codechecker.io/v1.3/

Codes

The front-end API can check if a code is valid, and mark a code as used. Data can be added to a code, and this data can be read, updated or deleted.

Get code Read

Gets a specific code, to check if it is valid. In this example we get code ABC123. If the code is valid, a result is returned as shown. If the code is not valid, an error is returned.

A code is considered valid when it exists and when the campaign it belongs to is active. Please note that a code is still valid even when it is spent - you should check this in your application.

Possible results

  • Succes Code found.
  • Error Code not found.

Returned data

  • result Indicates if the request was succesful.
  • code The requested code (for your convenience).
  • data The requested data (only on success).
    • id Unique identifier for this code.
    • campaign_id Unique identifier for the campaign this code belongs to.
    • code The requested code.
    • usage_count Number of times this code has been used.
    • usage_maximum Maximum number of times this code may be used.
    • created Timestamp when the code was created.
    • updated Timestamp when the code was last updated.
    • valid_from Timestamp from when the campaign this code belongs to is valid, or null when no timestamp is set.
    • valid_to Timestamp until the campaign this code belongs to is valid, or null when no timestamp is set.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/codes/ABC123 { "result": true, "code": "ABC123", "data": {   "id": "1",   "campaign_id": "1",   "code": "ABC123",   "usage_count": "0",   "usage_maximum": "1",   "created": "2017-01-01 00:00:00",   "updated": "2017-01-01 00:00:00",   "valid_from": null,   "valid_to": null  } } { "result": false, "code": "ABC123", "error": "not-found" }

Use code Update

Marks a specific code as used and updates the usage count. In this example we use code ABC123. If the code can be used, a result is returned as shown. If the code cannot be used, an error is returned.

Depending on the configuration of your campaign, a code can be used more than once. As long as the usage_count is lower than usage_maximum, a code can be used again. When a code is spent (used to its maximum) the code cannot be used again.

Optionally, you can add data to the used code. This data will only be added if the code use request succeeds.

When the code can be used but adding the data fails, the call will return a success status with an additional error message. The returned data is identical as when no data is added.

For more information about adding data and the corresponding error messages, see the Add code data chapter.

Possible results

  • Succes Code used.
  • Error Code already used.

Returned data

  • result Indicates if the request was succesful.
  • code The requested code (for your convenience).
  • data The requested data.
    • id Unique identifier for this code.
    • campaign_id Unique identifier for the campaign this code belongs to.
    • code The requested code.
    • usage_count Number of times this code has been used.
    • usage_maximum Maximum number of times this code may be used.
    • created Timestamp when the code was created.
    • updated Timestamp when the code was last updated.
    • valid_from Timestamp from when the campaign this code belongs to is valid, or null when no timestamp is set.
    • valid_to Timestamp until the campaign this code belongs to is valid, or null when no timestamp is set.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/codes/ABC123/use { "name": "CodeChecker", "demo": "yes" } { "result": true, "code": "ABC123", "data": {   "id": "1",   "campaign_id": "1",   "code": "ABC123",   "usage_count": "1",   "usage_maximum": "1",   "created": "2017-01-01 00:00:00",   "updated": "2017-01-01 00:00:00",   "valid_from": null,   "valid_to": null  } } { "result": false, "code": "ABC123", "data": {   "id": "1",   "campaign_id": "1",   "code": "ABC123",   "usage_count": "1",   "usage_maximum": "1",   "created": "2017-01-01 00:00:00",   "updated": "2017-01-01 00:00:00",   "valid_from": null,   "valid_to": null  }, "error": "already-used" }

Code data

Custom data can be added to a code, in the form of key-value pairs. This can for example be used to store customer details like name, email address, etc.

Get code data Read

Gets all data stored with a specific code and the associated campaign. In this example we get all data for code ABC123. If any data is found, a result is returned as shown. If no data is found, an error is returned.

Possible results

  • Succes Code data found.
  • Error Code data not found.

Returned data

  • result Indicates if the request was succesful.
  • code The requested code (for your convenience).
  • code_data The code data (only on success).
    • key-value pairs The data depends on what is stored with the code.
  • campaign_data The associated campaign data (only on success).
    • key-value pairs The data depends on what is stored with the campaign.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/codes/ABC123/data { "result": true, "code": "ABC123", "code_data": {   "name": "CodeChecker",   "demo": "yes"  }, "campaign_data": {   "name": "Campaign",   "demo": "yes"  } } { "result": false, "code": "ABC123", "error": "not-found" }

Add code data Create

Store a set of key-value pairs with a specific code. In this example we add some example data to code ABC123. If the data is added, a result is returned as shown. If the data is not added, an error is returned.

Possible results

  • Succes Code data is added.
  • Error Code data not found.

Returned data

  • result Indicates if the request was succesful.
  • code The requested code (for your convenience).
  • code_data The code data (only on success).
    • key-value pairs The data depends on what is stored with the code.
  • campaign_data The associated campaign data (only on success).
    • key-value pairs The data depends on what is stored with the campaign.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/codes/ABC123/data { "name": "CodeChecker", "demo": "yes" } { "result": true, "code": "ABC123", "code_data": {   "name": "CodeChecker",   "demo": "yes"  }, "campaign_data": {   "name": "Campaign",   "demo": "yes"  } } { "result": false, "code": "ABC123", "error": "not-found" }

Update code data Update

Update a set of key-value pairs with a specific code. In this example we update some example data to code ABC123. If the data is updated, a result is returned as shown. If the data is not updated, an error is returned.

Possible results

  • Succes Code data is updated.
  • Error Code data not found.

Returned data

  • result Indicates if the request was succesful.
  • code The requested code (for your convenience).
  • code_data The code data (only on success).
    • key-value pairs The data depends on what is stored with the code.
  • campaign_data The associated campaign data (only on success).
    • key-value pairs The data depends on what is stored with the campaign.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/codes/ABC123/data { "name": "CodeChecker", "demo": "no" } { "result": true, "code": "ABC123", "code_data": {   "name": "CodeChecker",   "demo": "no"  }, "campaign_data": {   "name": "Campaign",   "demo": "yes"  } } { "result": false, "code": "ABC123", "error": "not-found" }

Delete code data Delete

Delete a set of key-value pairs with a specific code. In this example we delete some example data from code ABC123. If the data is deleted, a result is returned as shown. If the data is not deleted, an error is returned.

Possible results

  • Succes Code data is deleted.
  • Error Code data not found.

Returned data

  • result Indicates if the request was succesful.
  • code The requested code (for your convenience).
  • code_data The code data (only on success).
    • key-value pairs The data depends on what is stored with the code.
  • campaign_data The associated campaign data (only on success).
    • key-value pairs The data depends on what is stored with the campaign.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/codes/ABC123/data { "name": "CodeChecker" } { "result": true, "code": "ABC123", "code_data": {   "demo": "no"  }, "campaign_data": {   "name": "Campaign",   "demo": "yes"  } } { "result": false, "code": "ABC123", "error": "not-found" }

Back-end endpoints

The back-end endpoints provide all available functions, including the functions to create new codes, edit campaigns, delete codes and data. These endpoints should never be used by a front-end website, to avoid abuse.

Back-end endpoints can be accessed only with back-end API keys.

https://demo.codechecker.io/v1.3/admin/

Get status Read

Gets the system status of the API, including server load and diskspace.

Possible results

  • Succes API status is requested.

Returned data

  • result Indicates if the request was succesful.
  • data The remaining data (only on success).
    • server_status Indicates if the server is up (it always is)
    • database_status Indicates if the database is up (it always is)
    • timestamp Current server time
    • disk_total Total disk space
    • disk_free Available disk space
    • disk_used Used disk space
    • load_avg Load average over the last minute, last 5 minutes and last 15 minutes
https://demo.codechecker.io/v1.3/admin/status/ { "result": true, "data": {   "server_status": "up",   "database_status": "up",   "timestamp": "2017-01-01 00:00:00",   "disk_total": 238840446976,   "disk_free": 72517091328,   "disk_used": 166323355648,   "load_avg": [     2.02880859375,     2.56005859375,     5.05712890625    ]  } }

Campaigns

Campaigns define what you will use your codes for, when they are valid, and what the codes should look like. The campaign defines all configuration for the codes - the length, syntax, which charactersets to use, which characters to exclude. Before you can generate codes, you will need to define at least one campaign, but you can create as many campaigns as you need.

 

Get all campaigns Read

Gets a list of all campaigns, with a maximum of 1,000 records. Use the limit and offset options to paginate the result.

Possible results

  • Succes Campaigns found.
  • Error Campaigns not found.

Returned data

  • result Indicates if the request was succesful.
  • data The requested data (only on success).
    • id Unique identifier for this campaign.
    • title Title of this campaign.
    • code_combinations Number of possible codes for this campaign.
    • code_method Method to generate codes, can be characterset or pattern.
    • code_length Length of the generated codes (method: characterset)
    • code_pattern Pattern of the generated codes (method: pattern)
    • code_uppercase Use uppercase letters in the generated codes (method: characterset)
    • code_lowercase Use lowercase letters in the generated codes (method: characterset)
    • code_digits Use digits in the generated codes (method: characterset)
    • code_special Use special characters in the generated codes (method: characterset)
    • code_punctuation Use punctuation characters in the generated codes (method: characterset)
    • code_brackets Use brackets in the generated codes (method: characterset)
    • code_space Use spaces in the generated codes (method: characterset)
    • code_extra_characters Use extra characters in the generated codes (method: characterset)
    • code_exclude_characters Characters to exclude in the generated codes
    • code_usage_maximum Maximum usage of the generated codes (can be overridden per code)
    • total_codes Total number of codes in this campaign
    • used_codes Total number of used codes in this campaign
    • spent_codes Total number of spent codes (used to the maximum) in this campaign
    • unused_codes Total number of unused codes (total codes - used codes) in this campaign
    • valid_from Timestamp from when the campaign is valid, or null when no timestamp is set.
    • valid_to Timestamp until the campaign is valid, or null when no timestamp is set.
    • remarks Remarks for this campaign.
    • created Timestamp when the campaign was created.
    • updated Timestamp when the campaign was last updated.
    • status Status of the campaign (active or inactive).
    • active Indicates if the campaign is currently active, based on status, valid_from and valid_to values.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/campaigns { "limit": "10", "offset": "0" } { "result": true, "data": [   {     "id": "1",     "title": "Example",     "code_combinations": "1099511627776",     "code_method": "characterset",     "code_length": "8",     "code_pattern": "XXX-999",     "code_uppercase": "1",     "code_lowercase": "0",     "code_digits": "1",     "code_special": "0",     "code_punctuation": "0",     "code_brackets": "0",     "code_space": "0",     "code_extra_characters": "",     "code_exclude_characters": "I, l, 1, |, 0, O",     "code_usage_maximum": "1",     "total_codes": "100000",     "used_codes": "0",     "spent_codes": "0",     "unused_codes": "100000",     "valid_from": null,     "valid_to": null,     "remarks": "",     "created": "2017-01-01 00:00:00",     "updated": "2017-01-01 00:00:00",     "status": "active",     "active": "1"     }  ] } { "result": false, "error": "not-found" }

Get single campaign Read

Gets a specific campaign. In this example we get campaign 1. If this campaign exists, a result is returned as shown. If this campaign does not exist, an error is returned.

Possible results

  • Succes Campaign found.
  • Error Campaign not found.

Returned data

  • result Indicates if the request was succesful.
  • campaign ID of the requested campaign (for your convenience).
  • data The requested data (only on success).
    • id Unique identifier for this campaign.
    • title Title of this campaign.
    • code_combinations Number of possible codes for this campaign.
    • code_method Method to generate codes, can be characterset or pattern.
    • code_length Length of the generated codes (method: characterset)
    • code_pattern Pattern of the generated codes (method: pattern)
    • code_uppercase Use uppercase letters in the generated codes (method: characterset)
    • code_lowercase Use lowercase letters in the generated codes (method: characterset)
    • code_digits Use digits in the generated codes (method: characterset)
    • code_special Use special characters in the generated codes (method: characterset)
    • code_punctuation Use punctuation characters in the generated codes (method: characterset)
    • code_brackets Use brackets in the generated codes (method: characterset)
    • code_space Use spaces in the generated codes (method: characterset)
    • code_extra_characters Use extra characters in the generated codes (method: characterset)
    • code_exclude_characters Characters to exclude in the generated codes
    • code_usage_maximum Maximum usage of the generated codes (can be overridden per code)
    • total_codes Total number of codes in this campaign
    • used_codes Total number of used codes in this campaign
    • spent_codes Total number of spent codes (used to the maximum) in this campaign
    • unused_codes Total number of unused codes (total codes - used codes) in this campaign
    • valid_from Timestamp from when the campaign is valid, or null when no timestamp is set.
    • valid_to Timestamp until the campaign is valid, or null when no timestamp is set.
    • remarks Remarks for this campaign.
    • created Timestamp when the campaign was created.
    • updated Timestamp when the campaign was last updated.
    • status Status of the campaign (active or inactive).
    • active Indicates if the campaign is currently active, based on status, valid_from and valid_to values.
    • queue_count Number of queue processes running for this campaign
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/campaigns/1 { "result": true, "campaign": 1, "data": [   {     "id": "1",     "title": "Example",     "code_combinations": "1099511627776",     "code_method": "characterset",     "code_length": "8",     "code_pattern": "XXX-999",     "code_uppercase": "1",     "code_lowercase": "0",     "code_digits": "1",     "code_special": "0",     "code_punctuation": "0",     "code_brackets": "0",     "code_space": "0",     "code_extra_characters": "",     "code_exclude_characters": "I, l, 1, |, 0, O",     "code_usage_maximum": "1",     "total_codes": "100000",     "used_codes": "0",     "spent_codes": "0",     "unused_codes": "100000",     "valid_from": null,     "valid_to": null,     "remarks": "",     "created": "2017-01-01 00:00:00",     "updated": "2017-01-01 00:00:00",     "status": "active",     "active": "1"     "queue_count": "0"     }  ] } { "result": false, "error": "not-found" }

Add campaign Create

Create a new campaign. In this example we create a campaign that will store codes with a length of 8 position, with only uppercase letters and digits, excluding the look-a-like characters O,0,I,1,B,8.

Empty values can be omitted, but are included in this example for documentation purposes.

If the campaign is created, a result is returned as shown. If the campaign is not created, an error is returned.

Please note: this only created the campaign, no codes are generated. Refer to the chapter Add campaign codes to generate codes.

Possible results

  • Succes Campaign is created.
  • Error Campaign is not created.

Returned data

  • result Indicates if the request was succesful.
  • campaign ID of the requested campaign (for your convenience).
  • data The requested data (only on success).
    • id Unique identifier for this campaign.
    • title Title of this campaign.
    • code_combinations Number of possible codes for this campaign.
    • code_method Method to generate codes, can be characterset or pattern.
    • code_length Length of the generated codes (method: characterset)
    • code_pattern Pattern of the generated codes (method: pattern)
    • code_uppercase Use uppercase letters in the generated codes (method: characterset)
    • code_lowercase Use lowercase letters in the generated codes (method: characterset)
    • code_digits Use digits in the generated codes (method: characterset)
    • code_special Use special characters in the generated codes (method: characterset)
    • code_punctuation Use punctuation characters in the generated codes (method: characterset)
    • code_brackets Use brackets in the generated codes (method: characterset)
    • code_space Use spaces in the generated codes (method: characterset)
    • code_extra_characters Use extra characters in the generated codes (method: characterset)
    • code_exclude_characters Characters to exclude in the generated codes
    • code_usage_maximum Maximum usage of the generated codes (can be overridden per code)
    • total_codes Total number of codes in this campaign
    • used_codes Total number of used codes in this campaign
    • spent_codes Total number of spent codes (used to the maximum) in this campaign
    • unused_codes Total number of unused codes (total codes - used codes) in this campaign
    • valid_from Timestamp from when the campaign is valid, or null when no timestamp is set.
    • valid_to Timestamp until the campaign is valid, or null when no timestamp is set.
    • remarks Remarks for this campaign.
    • created Timestamp when the campaign was created.
    • updated Timestamp when the campaign was last updated.
    • status Status of the campaign (active or inactive).
    • active Indicates if the campaign is currently active, based on status, valid_from and valid_to values.
    • queue_count Number of queue processes running for this campaign
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/campaigns { "title": "New campaign", "code_method": "characterset", "code_length": 8, "code_pattern": "", "code_uppercase": 1, "code_lowercase": 0, "code_digits": 1, "code_special": 0, "code_punctuation": 1, "code_brackets": 0, "code_space": 0, "code_extra_characters": "", "code_exclude_characters": "O,0,I,1,B,8", "code_usage_maximum": 1, "valid_from": "", "valid_to": "", "remarks": "", "status": "active" } { "result": true, "campaign": 2, "data": [   {     "id": "2",     "title": "New campaign",     "code_combinations": "2821109907456",     "code_method": "characterset",     "code_length": "8",     "code_pattern": "XXX-999",     "code_uppercase": "1",     "code_lowercase": "0",     "code_digits": "1",     "code_special": "0",     "code_punctuation": "0",     "code_brackets": "0",     "code_space": "0",     "code_extra_characters": "",     "code_exclude_characters": "O,0,I,1,B,8",     "code_usage_maximum": "1",     "total_codes": "100000",     "used_codes": "0",     "spent_codes": "0",     "unused_codes": "100000",     "valid_from": null,     "valid_to": null,     "remarks": "",     "created": "2017-01-01 00:00:00",     "updated": "2017-01-01 00:00:00",     "status": "active",     "active": "1"     "queue_count": "0"     }  ] } { "result": false, "error": "no-possible-codes" }

Update campaign Update

Update an existing campaign. In this example we update campaign 1. Empty values can be omitted, but are included in this example for documentation purposes.

If the campaign is updated, a result is returned as shown. If the campaign is not updated, an error is returned.

Please note: the code configuration cannot be changed. This would conflict with existing codes in the same campaign. If you need different codes, you can create a new campaign

Possible results

  • Succes Campaign is updated.
  • Error Campaign is not updated.

Returned data

  • result Indicates if the request was succesful.
  • campaign ID of the requested campaign (for your convenience).
  • data The requested data (only on success).
    • id Unique identifier for this campaign.
    • title Title of this campaign.
    • code_combinations Number of possible codes for this campaign.
    • code_method Method to generate codes, can be characterset or pattern.
    • code_length Length of the generated codes (method: characterset)
    • code_pattern Pattern of the generated codes (method: pattern)
    • code_uppercase Use uppercase letters in the generated codes (method: characterset)
    • code_lowercase Use lowercase letters in the generated codes (method: characterset)
    • code_digits Use digits in the generated codes (method: characterset)
    • code_special Use special characters in the generated codes (method: characterset)
    • code_punctuation Use punctuation characters in the generated codes (method: characterset)
    • code_brackets Use brackets in the generated codes (method: characterset)
    • code_space Use spaces in the generated codes (method: characterset)
    • code_extra_characters Use extra characters in the generated codes (method: characterset)
    • code_exclude_characters Characters to exclude in the generated codes
    • code_usage_maximum Maximum usage of the generated codes (can be overridden per code)
    • total_codes Total number of codes in this campaign
    • used_codes Total number of used codes in this campaign
    • spent_codes Total number of spent codes (used to the maximum) in this campaign
    • unused_codes Total number of unused codes (total codes - used codes) in this campaign
    • valid_from Timestamp from when the campaign is valid, or null when no timestamp is set.
    • valid_to Timestamp until the campaign is valid, or null when no timestamp is set.
    • remarks Remarks for this campaign.
    • created Timestamp when the campaign was created.
    • updated Timestamp when the campaign was last updated.
    • status Status of the campaign (active or inactive).
    • active Indicates if the campaign is currently active, based on status, valid_from and valid_to values.
    • queue_count Number of queue processes running for this campaign
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/campaigns/1 { "title": "Updated campaign", "valid_from": "", "valid_to": "", "remarks": "", "status": "active" } { "result": true, "campaign": 1, "data": [   {     "id": "2",     "title": "Updated campaign",     "code_combinations": "2821109907456",     "code_method": "characterset",     "code_length": "8",     "code_pattern": "XXX-999",     "code_uppercase": "1",     "code_lowercase": "0",     "code_digits": "1",     "code_special": "0",     "code_punctuation": "0",     "code_brackets": "0",     "code_space": "0",     "code_extra_characters": "",     "code_exclude_characters": "O,0,I,1,B,8",     "code_usage_maximum": "1",     "total_codes": "100000",     "used_codes": "0",     "spent_codes": "0",     "unused_codes": "100000",     "valid_from": null,     "valid_to": null,     "remarks": "",     "created": "2017-01-01 00:00:00",     "updated": "2017-01-01 00:00:00",     "status": "active",     "active": "1"     "queue_count": "0"     }  ] } { "result": false, "error": "no-data" }

Delete campaign Delete

Delete an inactive campaign. In this example we delete campaign 1.

If the campaign is deleted, a result is returned as shown. If the campaign is not deldete, an error is returned.

Please note: only inactive campaigns can be deleted, to prevent accidental deletion of an active campaign. To delete an active campaign, you will need to update the campaign first and set the status to inactive.

Possible results

  • Succes Campaign is delete.
  • Error Campaign is not delete.

Returned data

  • result Indicates if the request was succesful.
  • campaign ID of the requested campaign (for your convenience).
  • data The requested data (only on success).
    • id Unique identifier for this campaign.
    • title Title of this campaign.
    • code_combinations Number of possible codes for this campaign.
    • code_method Method to generate codes, can be characterset or pattern.
    • code_length Length of the generated codes (method: characterset)
    • code_pattern Pattern of the generated codes (method: pattern)
    • code_uppercase Use uppercase letters in the generated codes (method: characterset)
    • code_lowercase Use lowercase letters in the generated codes (method: characterset)
    • code_digits Use digits in the generated codes (method: characterset)
    • code_special Use special characters in the generated codes (method: characterset)
    • code_punctuation Use punctuation characters in the generated codes (method: characterset)
    • code_brackets Use brackets in the generated codes (method: characterset)
    • code_space Use spaces in the generated codes (method: characterset)
    • code_extra_characters Use extra characters in the generated codes (method: characterset)
    • code_exclude_characters Characters to exclude in the generated codes
    • code_usage_maximum Maximum usage of the generated codes (can be overridden per code)
    • total_codes Total number of codes in this campaign
    • used_codes Total number of used codes in this campaign
    • spent_codes Total number of spent codes (used to the maximum) in this campaign
    • unused_codes Total number of unused codes (total codes - used codes) in this campaign
    • valid_from Timestamp from when the campaign is valid, or null when no timestamp is set.
    • valid_to Timestamp until the campaign is valid, or null when no timestamp is set.
    • remarks Remarks for this campaign.
    • created Timestamp when the campaign was created.
    • updated Timestamp when the campaign was last updated.
    • status Status of the campaign (active or inactive).
    • active Indicates if the campaign is currently active, based on status, valid_from and valid_to values.
    • queue_count Number of queue processes running for this campaign
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/campaigns/1 { "result": true } { "result": false, "error": "not-inactive" }

Get campaign logs Read

Gets a list of all logs for a specific campaign, with a maximum of 1,000 records. Use the limit and offset options to paginate the result. In this example we get the logs for campaign 1. In the result the campaign is returned as shown, including any available logs. If no campaign logs exist, an error is returned.

Possible results

  • Succes Campaign logs found.
  • Error Campaign logs not found.

Returned data

  • result Indicates if the request was succesful.
  • campaign ID of the requested campaign (for your convenience).
  • data Campaign data.
    • id Unique identifier for this campaign.
    • title Title of this campaign.
    • code_combinations Number of possible codes for this campaign.
    • code_method Method to generate codes, can be characterset or pattern.
    • code_length Length of the generated codes (method: characterset)
    • code_pattern Pattern of the generated codes (method: pattern)
    • code_uppercase Use uppercase letters in the generated codes (method: characterset)
    • code_lowercase Use lowercase letters in the generated codes (method: characterset)
    • code_digits Use digits in the generated codes (method: characterset)
    • code_special Use special characters in the generated codes (method: characterset)
    • code_punctuation Use punctuation characters in the generated codes (method: characterset)
    • code_brackets Use brackets in the generated codes (method: characterset)
    • code_space Use spaces in the generated codes (method: characterset)
    • code_extra_characters Use extra characters in the generated codes (method: characterset)
    • code_exclude_characters Characters to exclude in the generated codes
    • code_usage_maximum Maximum usage of the generated codes (can be overridden per code)
    • total_codes Total number of codes in this campaign
    • used_codes Total number of used codes in this campaign
    • spent_codes Total number of spent codes (used to the maximum) in this campaign
    • unused_codes Total number of unused codes (total codes - used codes) in this campaign
    • valid_from Timestamp from when the campaign is valid, or null when no timestamp is set.
    • valid_to Timestamp until the campaign is valid, or null when no timestamp is set.
    • remarks Remarks for this campaign.
    • created Timestamp when the campaign was created.
    • updated Timestamp when the campaign was last updated.
    • status Status of the campaign (active or inactive).
    • active Indicates if the campaign is currently active, based on status, valid_from and valid_to values.
    • queue_count Number of queue processes running for this campaign
  • logs The requested data (only on success).
    • id Unique identifier for this log.
    • action The action that created this log.
    • content_id Unique identifier for the content.
    • content_table Identifier for the type of content.
    • request Serialised string of the logged request.
    • response Serialised string of the logged response.
    • ip_address IP address from which the log originated.
    • timer The duration of the logged request.
    • created Timestamp when the log was created.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/campaigns/1/logs { "limit": "10", "offset": "0" } { "result": true, "campaign": 1, "data": [   {     "id": "2",     "title": "New campaign",     "code_combinations": "2821109907456",     "code_method": "characterset",     "code_length": "8",     "code_pattern": "XXX-999",     "code_uppercase": "1",     "code_lowercase": "0",     "code_digits": "1",     "code_special": "0",     "code_punctuation": "0",     "code_brackets": "0",     "code_space": "0",     "code_extra_characters": "",     "code_exclude_characters": "O,0,I,1,B,8",     "code_usage_maximum": "1",     "total_codes": "100000",     "used_codes": "0",     "spent_codes": "0",     "unused_codes": "100000",     "valid_from": null,     "valid_to": null,     "remarks": "",     "created": "2017-01-01 00:00:00",     "updated": "2017-01-01 00:00:00",     "status": "active",     "active": "1"     "queue_count": "0"     }  ] "logs": [   {     "id": "1",     "action": "updateCampaign",     "content_id": "2",     "content_table": "cc_campaigns",     "request": "a:1:{s:6:\"status\";s:8:\"inactive\";}",     "response": "a:4:{s:6:\"result\";b:1;s:8:\"campaign\";}",     "ip_address": "123.456.789.0",     "timer": "0.0123",     "created": "2017-01-01 00:00:00"    }  ] } { "result": false, "error": "not-found" }

Get campaigns usage Read

Gets a list of all used codes for a specific campaign, with a maximum of 1,000 records. Use the limit and offset options to paginate the result. In this example we get the usage for campaign 1. In the result the campaign is returned as shown, including any available usage. If no campaign usage exist, an error is returned.

The campaigns usage can be captured by date, week, month or year. To do so, place /date, /week, /month or /year behind usage in the Endpoint. Endow the date_from and the date_to in the input. In this example we use /date.

Possible results

  • Succes Campaign usage found.
  • Error Campaign usage not found.

Returned data

  • result Indicates if the request was succesful.
  • data Campaign data.
    • week The week number.
    • day The day of the week in numbers.
    • weekend Shows if the day is during the weekend.
    • holiday Shows if the day is a holiday.
    • event Shows if there are any events on that day.
    • total_codes The total amount of codes that are used on that day.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/campaigns/1/usage/date { "limit": "10", "offset": "0", "date_from":"2017-01-01", "date_to":"2017-01-02" } { "result": true, "data": [    {     "week": "01",     "day": "01",     "weekend": "1",     "holiday": "1",     "event": "New Years Day",     "total_codes": "2"    },  ] } { "result": false, "error": "not-found" }

Preview campaign codes Create

Create a list of preview campaign codes. In this example we create preview campaign codes with a length of 8 position, with only uppercase letters and digits, excluding the look-a-like characters O,0,I,1,B,8.

Empty values can be omitted, but are included in this example for documentation purposes.

If the preview codes are created, a result is returned as shown. If the campaign is not created, an error is returned.

Please note: this only created preview campaign codes. Refer to the chapter Add campaign codes to generate codes.

Possible results

  • Succes Preview campaign codes generated
  • Error Preview campaign codes not generated

Returned data

  • result Indicates if the request was succesful.
  • code_combinations Number of possible codes for this campaign.
  • code_amount The total amount of preview campaign codes.
  • data The requested data (only on success).
    • The ten generated preview campaign codes.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/campaigns/preview { "title": "Preview campaign codes", "code_amount": 10, "code_method": "characterset", "code_length": 8, "code_pattern": "", "code_uppercase": 1, "code_lowercase": 0, "code_digits": 1, "code_special": 0, "code_punctuation": 1, "code_brackets": 0, "code_space": 0, "code_extra_characters": "", "code_exclude_characters": "O,0,I,1,B,8", "code_usage_maximum": 1, "valid_from": "", "valid_to": "", "remarks": "", "status": "active" }   { "result": true, "code_combinations": 2821109907456, "code_amount": 10, "data": [     "M,;AAZ?;",     "NEXWWEGX",     "DHV.WG5.",     "!PM2.WLA",     "5GVW3767",     "A?::.:FY",     "HT9F;T7E",     "P2AA25MY",     ":ZQ?;PEN",     "HYGUJ4U5"    },  ] } { "result": false, "error": "not-found" }

Campaign data

Content goes here

 

Get campaign data Read

Gets all data stored with a specific campaign. You need the id of the campaign to get the data. In this example we get all data for campaign 1. If any data is found, a result is returned as shown. If no data is found, an error is returned.

Possible results

  • Succes Campaign data found.
  • Error Campaign data not found.

Returned data

  • result Indicates if the request was succesful.
  • id Unique identifier for this campaign.
  • data The added data (only on success).
    • title Title of the campaign.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/campaigns/1/data { "result": true, "id": 1, "data": {   "title": "example campaign"  } } { "result": false, "error": "not-found" }

Add campaign data Create

Store a set of key-value pairs with a specific campaign. In this example we add some example data to campaign 1. If the data is added, a result is returned as shown. If the data is not added, an error is returned.

Possible results

  • Succes Campaign data is added.
  • Error Campaign data is not added.

Returned data

  • result Indicates if the request was succesful.
  • id Unique identifier for this campaign.
  • data The added data (only on success).
    • campaign-name Name of the key-value that was added.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/campaigns/1/data { "campaign-name": "example campaign" } { "result": true, "id": 1, "data": {   "title": "example campaign",   "campaign-name": "example campaign",  } } { "result": false, "error": "not-found" }

Update campaign data Update

Update a set of key-value pairs with a specific campaign. In this example we update some example data to campaign 1. If the data is updated, a result is returned as shown. If the data is not updated, an error is returned.

Possible results

  • Succes Campaign data updated.
  • Error Campaign data not updated.

Returned data

  • result Indicates if the request was succesful.
  • campaign The requested code (for your convenience).
  • data The updated data (only on success).
    • key-value pairs The data depends on what is stored with the campaign.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/campaigns/1/data { "campaign-name": "updated example campaign" } { "result": true, "id": 1, "data": {   "title": "example campaign",   "campaign-name": "example campaign",  } } { "result": false, "error": "not-found" }

Delete campaign data Delete

Delete a set of key-value pairs with a specific campaign. In this example we delete some example data from campaign 1. If the data is deleted, a result is returned as shown. If the data is not deleted, an error is returned.

Possible results

  • Succes Campaign data deleted.
  • Error Campaign data not deleted.

Returned data

  • result Indicates if the request was succesful.
  • id Unique identifier for this campaign.
  • data The added data (only on success).
    • title Title of the campaign.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/campaigns/1/data { "title": "updated example campaign" } { "result": true, "id": 1, "data": {   "title": "updated example campaign",  } } { "result": false, "error": "not-found" }

Codes

Content goes here

 

Get Campaign Codes Read

Gets a list of all the codes of a specific campaign with a maximum of 1,000 records. Use the limit and offset options to paginate the result. In this example we get all the codes for campaign 1. In the result the codes are returned as shown. If no codes are in the campaign, an error is returned.

Possible results

  • Succes Campaign codes found.
  • Error Campaign codes not found.

Returned data

  • result Indicates if the request was succesful.
  • campaign ID of the requested campaign (for your convenience).
  • limit The maximun amount of shown codes.
  • offset The id number of the code where the counting must start.
  • result_codes The total amount of shown codes.
  • total_codes The total amount of codes that are in the campaign.
  • data Campaign data.
    • id Unique identifier for this code.
    • campaign_id Unique identifier for this campaign.
    • code The requested code (for your convenience).
    • usage_count Number of times this code has been used.
    • usage_maximum Maximum number of times this code may be used.
    • created Timestamp when the code was created.
    • updated Timestamp when the code was last updated.
    • valid_from Timestamp from when the campaign this code belongs to is valid, or null when no timestamp is set.
    • valid_to Timestamp until the campaign this code belongs to is valid, or null when no timestamp is set.
    • status Status of the code (active or inactive).
    • active Indicates if the code is currently active, based on status, valid_from and valid_to values.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/campaigns/1/codes { "limit": "10", "offset": "0", }   { "result": true, "campaign": 2, "limit": 10, "offset": 0, "result_codes": 10, "total_codes": 100000, "data": [    {     "id": "1",     "campaign_id": "1",     "code": "ABC123",     "usage_count": "1",     "usage_maximum": "1",     "created": "2017-01-01 00:00:00",     "updated": "2017-01-01 00:00:00",     "valid_from": null,     "valid_to": null,     "status": "active",     "active": "1"    },  ] } { "result": false, "campaign": 2, "error": "not-found" }

Add Campaign Codes

It is not possible to add codes to a campaign directly. Instead an order is added to the queue, which will handle the generation of the codes.

For more information, see: Add queue

Get all codes Read

Gets a list of all the codes, with a maximum of 1,000 records. Use the limit and offset options to paginate the result. In the result the codes are returned as shown. If no codes exist, an error is returned.

Possible results

  • Succes Codes found.
  • Error Codes not found.

Returned data

  • result Indicates if the request was succesful.
  • limit The maximun amount of shown codes.
  • offset The id number of the code where the counting must start.
  • result_codes The total amount of shown codes.
  • total_codes The total amount of codes that are in the campaign.
  • data Campaign data.
    • id Unique identifier for this code.
    • campaign_id Unique identifier for this campaign.
    • code The requested code (for your convenience).
    • usage_count Number of times this code has been used.
    • usage_maximum Maximum number of times this code may be used.
    • created Timestamp when the code was created.
    • updated Timestamp when the code was last updated.
    • valid_from Timestamp from when the campaign this code belongs to is valid, or null when no timestamp is set.
    • valid_to Timestamp until the campaign this code belongs to is valid, or null when no timestamp is set.
    • status Status of the code (active or inactive).
    • active Indicates if the code is currently active, based on status, valid_from and valid_to values.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/codes { "limit": "10", "offset": "0", }   { "result": true, "limit": 1000, "offset": 0, "result_codes": 1000, "total_codes": 100000, "data": [  {    "id": "1",    "campaign_id": "1",    "code": "ABC123",    "usage_count": "1",    "usage_maximum": "1",    "created": "2017-01-01 00:00:00",    "updated": "2017-01-01 00:00:00",    "valid_from": null,    "valid_to": null,    "status": "active",    "active": "1"   },  ] } { "result": false, "campaign": 2, "error": "not-found" }

Get single code Read

Gets a specific code of a campaign by id. In the result the code is returned as shown. If the code doesn't exist, an error is returned.

Possible results

  • Succes Code is found.
  • Error Code is not found.

Returned data

  • result Indicates if the request was succesful.
  • id Unique identifier for this code.
  • data Campaign data.
    • id Unique identifier for this code.
    • campaign_id Unique identifier for this campaign.
    • code The requested code (for your convenience).
    • usage_count Number of times this code has been used.
    • usage_maximum Maximum number of times this code may be used.
    • remarks Remarks for this campaign.
    • created Timestamp when the code was created.
    • updated Timestamp when the code was last updated.
    • valid_from Timestamp from when the campaign this code belongs to is valid, or null when no timestamp is set.
    • valid_to Timestamp until the campaign this code belongs to is valid, or null when no timestamp is set.
    • status Status of the code (active or inactive).
    • active Indicates if the code is currently active, based on status, valid_from and valid_to values.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/codes { "limit": "10", "offset": "0", }   { "result": true, "id": 1, "data": {  {    "id": "1",    "campaign_id": "1",    "code": "ABC123",    "usage_count": "1",    "usage_maximum": "1",    "remarks": "",    "created": "2017-01-01 00:00:00",    "updated": "2017-01-01 00:00:00",    "valid_from": null,    "valid_to": null,    "status": "active",    "active": "1"  ] } { "result": false, "id": 0, "error": "not-found" }

Add code Create

Add a unique code to the campaign. In the result the code is returned as shown. If the code can't be created, an error is returned.

Possible results

  • Succes Code is add.
  • Error Code is not add.

Returned data

  • result Indicates if the request was succesful.
  • id Unique identifier for this code.
  • data Code data.
    • id Unique identifier for this code.
    • campaign_id Unique identifier for this campaign.
    • code The requested code (for your convenience).
    • usage_count Number of times this code has been used.
    • usage_maximum Maximum number of times this code may be used.
    • remarks Remarks for this campaign.
    • created Timestamp when the code was created.
    • updated Timestamp when the code was last updated.
    • valid_from Timestamp from when the campaign this code belongs to is valid, or null when no timestamp is set.
    • valid_to Timestamp until the campaign this code belongs to is valid, or null when no timestamp is set.
    • status Status of the code (active or inactive).
    • active Indicates if the code is currently active, based on status, valid_from and valid_to values.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/codes/1 { "code_amount": "1" }   { "result": true, "id": 100002, "data": {    "id": "100002",    "campaign_id": "1",    "code": "ABC123",    "usage_count": "0",    "usage_maximum": "1",    "remarks": "",    "created": "2017-01-01 00:00:00",    "updated": "2017-01-01 00:00:00",    "valid_from": null,    "valid_to": null,    "status": "active",    "active": "1"  } }

Update code Update

Update a specific code of a campaign by id. In the result the code is returned as shown. If the code can't be updated, an error is returned.

Possible results

  • Succes Code is updated.
  • Error Code is not updated.

Returned data

  • result Indicates if the request was succesful.
  • id Unique identifier for this code.
  • data Code data.
    • id Unique identifier for this code.
    • campaign_id Unique identifier for this campaign.
    • code The requested code (for your convenience).
    • usage_count Number of times this code has been used.
    • usage_maximum Maximum number of times this code may be used.
    • remarks Remarks for this campaign.
    • created Timestamp when the code was created.
    • updated Timestamp when the code was last updated.
    • valid_from Timestamp from when the campaign this code belongs to is valid, or null when no timestamp is set.
    • valid_to Timestamp until the campaign this code belongs to is valid, or null when no timestamp is set.
    • status Status of the code (active or inactive).
    • active Indicates if the code is currently active, based on status, valid_from and valid_to values.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/codes/1 { "usage_count": "1", "usage_maximum": "10" }   { "result": true, "id": 2, "data": {    "id": "2",    "campaign_id": "1",    "code": "ABC123",    "usage_count": "1",    "usage_maximum": "10",    "remarks": "",    "created": "2017-01-01 00:00:00",    "updated": "2017-01-01 00:00:00",    "valid_from": null,    "valid_to": null,    "status": "active",    "active": "1"  } }   { "result": true, "id": 2, "data": {    "id": "2",    "campaign_id": "1",    "code": "ABC123",    "usage_count": "1",    "usage_maximum": "10",    "remarks": "",    "created": "2017-01-01 00:00:00",    "updated": "2017-01-01 00:00:00",    "valid_from": null,    "valid_to": null,    "status": "active",    "active": "1"  } "error": "no-data" }

Delete code Delete

Delete a specific code of a campaign by id. In this example we delete code ABC123 with id 1. In the result the code is returned as shown. If the code can't be deleted, an error is returned.

Possible results

  • Succes Code is deleted.
  • Error Code is not deleted.

Returned data

  • result Indicates if the request was succesful.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/codes/1   { "result": true }   { "result": false, "error": "not-found" }

Get codes logs Read

Gets a list of logs from a code, with a maximum of 1,000 records. Use the limit and offset options to paginate the result.

Possible results

  • Succes Logs found.
  • Error Logs not found.

Returned data

  • result Indicates if the request was succesful.
  • id Unique identifier for this code.
  • data The requested data (only on success).
    • id Unique identifier for this code.
    • campaign_id Unique identifier for this campaign.
    • code The requested code (for your convenience).
    • usage_count Number of times this code has been used.
    • usage_maximum Maximum number of times this code may be used.
    • remarks Remarks for this campaign.
    • created Timestamp when the code was created.
    • updated Timestamp when the code was last updated.
    • valid_from Timestamp from when the campaign this code belongs to is valid, or null when no timestamp is set.
    • valid_to Timestamp until the campaign this code belongs to is valid, or null when no timestamp is set.
    • status Status of the code (active or inactive).
    • active Indicates if the code is currently active, based on status, valid_from and valid_to values.
  • logs The requested data (only on success).
    • id Unique identifier for this log.
    • action The action that created this log.
    • code The requested code (for your convenience).
    • content_id Unique identifier for the content.
    • content_table Identifier for the type of content.
    • request Serialised string of the logged request.
    • response Serialised string of the logged response.
    • ip_address IP address from which the log originated.
    • timer The duration of the logged request.
    • created Timestamp when the log was created.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/codes/1/logs { "limit": "10", "offset": "0" }   { "result": true, "id": 5, "data": {    "id": "5",    "campaign_id": "1",    "code": "ABC123",    "usage_count": "1",    "usage_maximum": "1",    "remarks": "",    "created": "2017-01-01 00:00:00",    "updated": "2017-01-01 00:00:00",    "valid_from": null,    "valid_to": null,    "status": "active",    "active": "1" }, "logs": [   {    "id": "106",    "action": "updateCode",    "code": null,    "content_id": "5",    "content_table": "cc_codes",    "request": "",    "response": "a:4:{s:6:\"result\";b:0;s:2:\"id\";i:5;s:4:\"data\";a:12:{s:2:\"id\";s:1:\"5\";s:11:\"campaign_id\";s:1:\"1\";s:4:\"code\";s:8:\"ABC123\";s:11:\"usage_count\";s:1:\"1\";s:13:\"usage_maximum\";s:1:\"1\";s:7:\"remarks\";s:0:\"\";s:7:\"created\";s:19:\"2017-05-31 21:28:02\";s:7:\"updated\";s:19:\"2017-06-13 11:08:35\";s:10:\"valid_from\";N;s:8:\"valid_to\";N;s:6:\"status\";s:6:\"active\";s:6:\"active\";s:1:\"1\";}s:5:\"error\";s:7:\"no-data\";}",    "ip_address": "83.160.81.104",    "timer": "0.011540",    "created": "2017-01-01 00:00:00"   }, ] }   { { "result": false, "error": "not-found" } }

Get codes totals Read

Gets a list of all codes in a campaign, with a maximum of 1,000 records. Use the limit and offset options to paginate the result.

Possible results

  • Succes Codes totals found.
  • Error Code totals not found.

Returned data

  • result Indicates if the request was succesful.
  • limit Unique identifier for this code.
  • offset The id number of the code where the counting must start.
  • liresult_codesmit
  • total_codes Total number of codes in this campaign
  • data Code data.
    • id Unique identifier for this code.
    • campaign_id Unique identifier for the campaign this code belongs to.
    • code The requested code.
    • usage_count Total number of used codes in this campaign
    • usage_maximum Maximum usage of the generated codes (can be overridden per code)
    • created Timestamp when the campaign was created.
    • updated Timestamp when the campaign was last updated.
    • valid_from Timestamp from when the campaign is valid, or null when no timestamp is set.
    • valid_to Timestamp until the campaign is valid, or null when no timestamp is set.
    • status Status of the campaign (active or inactive).
    • active Indicates if the campaign is currently active, based on status, valid_from and valid_to values.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/codes/   { "result": true, "limit": 1000, "offset": 0, "result_codes": 1000, "total_codes": 100011, "data": [  {    "id": "1",    "campaign_id": "1",    "code": "ABC123",    "usage_count": "1",    "usage_maximum": "1",    "created": "2017-01-01 00:00:00",    "updated": "2017-01-01 00:00:00",    "valid_from": null,    "valid_to": null,    "status": "active",    "active": "1"  }, }   { "result": false, "error": "not-found" }

Get codes usage Read

Gets a list of all used codes for a specific campaign, with a maximum of 1,000 records. Use the limit and offset options to paginate the result. In this example we get the usage for campaign 1. In the result the campaign is returned as shown, including any available usage. If no campaign usage exist, an error is returned.

The campaigns usage can be captured by date, week, month or year. To do so, place /date, /week, /month or /year behind usage in the Endpoint. Endow the date_from and the date_to in the input. In this example we use /date.

Possible results

  • Succes Code usage found.
  • Error Code usage not found.

Returned data

  • result Indicates if the request was succesful.
  • data Campaign data.
    • week The week number.
    • day The day of the week in numbers.
    • weekend Shows if the day is during the weekend.
    • holiday Shows if the day is a holiday.
    • event Shows if there are any events on that day.
    • date The day of the week and date.
    • total_codes The total amount of codes that are used on that day.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/campaigns/1/usage/date { "limit": "10", "offset": "0", "date_from":"2017-01-01", "date_to":"2017-01-02" } { "result": true, "data": [    {     "week": "01",     "day": "01",     "weekend": "1",     "holiday": "1",     "event": "New Years Day",     "date": "Sunday 01 January"     "total_codes": "2"    },  ] } { "result": false, "error": "not-found" }

Code data

Content goes here

 

Get code data Read

Gets all data stored with a specific code and the associated campaign. You need the id of the code to get the data. In this example we get all data for the code with id 1. If any data is found, a result is returned as shown. If no data is found, an error is returned.

If data with the same key is found in both the campaign and code, the value stored with the code is returned. The data stored with the code is more specific (for this code only) than the data stored with the campaign (for all codes in this campaign), so it is supposed to be more reliable.

Possible results

  • Succes Code data found.
  • Error Code data not found.

Returned data

  • result Indicates if the request was succesful.
  • id Unique identifier for this code.
  • code_data The code data (only on success).
    • key-value pairs The data depends on what is stored with the code.
  • campaign_data The associated campaign data (only on success).
    • key-value pairs The data depends on what is stored with the campaign.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/codes/1/data { "result": true, "id": 1, "code_data": {   "title": "example code"  }, "campaign_data": {   "name": "Campaign",   "demo": "yes"  } } { "result": false, "error": "not-found" }

Add code data Create

Store a set of key-value pairs with a specific code. In this example we add some example data to code ABC123 with id 1. If the data is added, a result is returned as shown. If the data is not added, an error is returned.

Possible results

  • Succes Code data is added.
  • Error Code data is not added.

Returned data

  • result Indicates if the request was succesful.
  • id Unique identifier for this code.
  • code_data The code data (only on success).
    • key-value pairs The data depends on what is stored with the code.
  • campaign_data The associated campaign data (only on success).
    • key-value pairs The data depends on what is stored with the campaign.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/codes/1/data { "code-name": "example code" } { "result": true, "id": 1, "code_data": {   "title": "example code",   "code-name": "example code",  }, "campaign_data": {   "name": "Campaign",   "demo": "yes"  } } { "result": false, "error": "not-found" }

Update code data Update

Update a set of key-value pairs with a specific code. In this example we update some example data to code ABC123 with id 1. If the data is updated, a result is returned as shown. If the data is not updated, an error is returned.

Possible results

  • Succes Code data updated.
  • Error Code data not updated.

Returned data

  • result Indicates if the request was succesful.
  • code The requested code (for your convenience).
  • code_data The code data (only on success).
    • key-value pairs The data depends on what is stored with the code.
  • campaign_data The associated campaign data (only on success).
    • key-value pairs The data depends on what is stored with the campaign.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/codes/1/data { "code-name": "updated example code" } { "result": true, "id": 1, "code_data": {   "title": "example code",  }, "campaign_data": {   "name": "Campaign",   "demo": "yes"  } } { "result": false, "error": "not-found" }

Delete code data Delete

Delete a set of key-value pairs with a specific code. In this example we delete some example data from code ABC123 with id 1. If the data is deleted, a result is returned as shown. If the data is not deleted, an error is returned.

Possible results

  • Succes Code data deleted.
  • Error Code data not deleted.

Returned data

  • result Indicates if the request was succesful.
  • id Unique identifier for this code.
  • code_data The code data (only on success).
    • key-value pairs The data depends on what is stored with the code.
  • campaign_data The associated campaign data (only on success).
    • key-value pairs The data depends on what is stored with the campaign.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/codes/1/data { "code-name": "updated example code" } { "result": true, "id": 1, "code_data": {   "title": "example code",  }, "campaign_data": {   "name": "Campaign",   "demo": "yes"  } } { "result": false, "error": "not-found" }

Queue

Generate a big amount of code with a queue.

 

Get queue Read

Gets a list of all queue's, In the result the campaign is returned as shown, including any available logs. If no campaign logs exist, an error is returned.

Possible results

  • Succes Code data is found.
  • Error Code data is not found.

Returned data

  • result Indicates if the request was succesful.
  • data The added data (only on success).
    • id Unique identifier for this campaign.
    • campaign_id Unique identifier for this campaign.
    • code_amount The amount of codes that will be generated.
    • total_amount The total amount of codes that will be generated.
    • action The action that created this log.
    • title Title of this campaign.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/queue { "result": true, "data": {    "id": "1",    "campaign_id": "1",    "code_amount": "1000000",    "total_amount": "1000000",    "action": "generate",    "title": "Updated campaign"   } } { "result": false, "error": "not-found" }

Add queue Create

Add a queue to a campaign. In this example we add a queue to campaign 1. If the queue is added, a result is returned as shown. If the queue is not added, an error is returned.

Possible results

  • Succes Queue is added.
  • Error Queue is not added.

Returned data

  • result Indicates if the request was succesful.
  • data The added data (only on success).
    • id Unique identifier for this campaign.
    • campaign_id Unique identifier for this campaign.
    • code_amount The amount of codes that will be generated.
    • total_amount The total amount of codes that will be generated.
    • title Title of this campaign.
    • created Timestamp when the queue was created.
    • id Unique identifier for this queue.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/queue { "code_amount":"1000000", "campaign_id":"1", "action":"generate" } { "result": true, "data": {    "id": "1",    "campaign_id": "1",    "code_amount": "1000000",    "total_amount": "1000000",    "title": "Updated campaign"    "created": "2017-01-01 00:00:00"    "id": 1   } } { "result": false, "error": "not-found" }

Delete queue Delete

Delete a queue by id. In this example we delete the queue with id 1. If the queue is deleted, a result is returned as shown. If the queue is not deleted, an error is returned.

Possible results

  • Succes Queue is deleted.
  • Error Queue is not deleted.

Returned data

  • result Indicates if the request was succesful.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/queue/1 { "result": true } { "result": false, "error": "not-found" }

Exports

Content goes here

 

Get exports Read

Gets a list of all exports, with a maximum of 1,000 records. Use the limit and offset options to paginate the result.

Possible results

  • Succes Exports found.
  • Error Exports not found.

Returned data

  • result Indicates if the request was succesful.
  • data Campaign data.
    • id Unique identifier for this export.
    • campaign_id Unique identifier for this campaign.
    • type The type of code that are export.
    • description The description of the export.
    • export_from The date and time where the where export start.
    • export_to The date and time where the where export stops.
    • created The time and date the export was created.
    • completed The time and date the export was completed.
    • finished Indicates if the export is finished.
    • downloaded Indicates if the export is downloaded.
    • codes_total Total amount of codes in this export.
    • title Title of this campaign.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/exports { "limit": "10", "offset": "0" } { "result": true, "data": [   {   "id": "1",   "campaign_id": "1",   "type": "all",   "description": "",   "export_from": null,   "export_to": "2017-01-01 00:00:00",   "created": "2017-01-01 00:00:00",   "completed": "2017-01-01 00:00:00",   "finished": "1",   "downloaded": "1",   "codes_total": "20000",   "title": "New campaign"   }  ] } { "result": false, "error": "not-found" }

Get single export Read

Gets a specific export. In this example we get export 1. If this export exists, a result is returned as shown. If this export does not exist, an error is returned.

Possible results

  • Succes Export is found.
  • Error Export is not found.

Returned data

  • result Indicates if the request was succesful.
  • id Unique identifier for this export.
  • data Export data.
    • id Unique identifier for this export.
    • campaign_id Unique identifier for this campaign (optinoal).
    • type The type of codes in this export.
    • description Description of this export.
    • export_from Timestamp from when codes in this export are included, or null when no timestamp is set.
    • export_to Timestamp until when codes in this export are included.
    • finished Indicates if this export has finished.
    • downloaded Indicates if this export has been downloaded.
    • email Notification e-mail adress.
    • created Timestamp when the export was created.
    • completed Timestamp when the export was last completed.
    • codes_per_file The number of codes in each file in this export.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/exports/1   { "result": true, "export": 1, "data": {  {    "id": "1",    "campaign_id": null,    "type": "all",    "description": "",    "export_from": null,    "export_to": "2017-01-01 00:00:00",    "finished": "1",    "downloaded": "1",    "email": "",    "created": "2017-01-01 00:00:00",    "completed": "2017-01-01 00:00:00",    "codes_per_file": "100000000"  ] } { "result": false, "error": "not-found" }

Download export Read

Downloads a specific export file by id. In the result the contents of the file is returned. If the export doesn't exist, an error is returned.

Possible results

  • Succes Export is found.
  • Error Export is not found.

Returned data

Please note: this call does not return a JSON result! Instead, it returns a data stream of the actual file data.

https://demo.codechecker.io/v1.3/admin/exports/1/download

Add exports Create

Add a export. If the export is added, a result is returned as shown. If the export is not added, an error is returned.

Possible results

  • Succes Exports added.
  • Error Exports not added.

Returned data

  • result Indicates if the request was succesful.
  • export ID of the requested campaign (for your convenience).
  • data Number of the export.
    • id Unique identifier for this export.
    • campaign_id Unique identifier for the campaing that is exported.
    • type The type of code that are export.
    • description The description of the export.
    • export_from The date and time where the where export start.
    • export_to The date and time where the where export stops.
    • finished Indicates if the export is finished.
    • downloaded Indicates if the export is downloaded.
    • email The given email acount.
    • created The time and date the export was created.
    • completed The time and date the export was completed.
    • filetype The type of file that is used to export the code.
    • codes_per_file The amount of codes that wil be exported per file.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/exports { "export_from":"2017-01-01 00:00:00", "export_to": "2017-01-02 00:00:00", "type":"all" } { "result": true, "export": 1, "data": {   "id": "`1",   "campaign_id": null,   "type": "all",   "description": "",   "export_from": null,   "export_to": "2017-01-01 00:00:00",   "finished": "0",   "downloaded": "0",   "email": "",   "created": "2017-01-01 00:00:00",   "completed": null,   "filetype": "csv",   "codes_per_file": "100000000"   } } { "result": false, "error": "not-found" }

Delete export Delete

Delete a export by id. In this example we delete the export with id 1. If the export is deleted, a result is returned as shown. If the export is not deleted, an error is returned.

Possible results

  • Succes Export deleted.
  • Error Export not deleted.

Returned data

  • result Indicates if the request was succesful.
  • data Export data.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/exports { "result": true, "data": "" } { "result": false, "error": "no-exports-found" }

API keys

Content goes here

 

Get API keys Read

Gets a list of all API keys, with a maximum of 1,000 records. Use the limit and offset options to paginate the result.

Possible results

  • Succes API keys found.
  • Error API keys not found.

Returned data

  • result Indicates if the request was succesful.
  • data API keys.
    • id Unique identifier for this API key.
    • api_key The key for this API key.
    • api_secret The secret for this API key.
    • title The title for this API key.
    • allowed_host The hostname that is allowed to use this API key.
    • admin Indicates if this is an admin-level API key.
    • date_expire The expire date of this API key.
    • created Timestamp when the API key was created.
    • updated Timestamp when the API key was last updated.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/api_keys { "limit": "10", "offset": "0" } { "result": true, "data": [   {   "id": "1",   "api_key": "2cg4lbcQ86FBgjubrcNtvCSNcO6ALo78",   "api_secret": "kePVArQJOqCkzELXfDPQlapQtFhO9D0S",   "title": "Front-end API key",   "allowed_host": "*",   "admin": "0",   "date_expire": "2017-12-31",   "created": "2017-01-01 00:00:00",   "updated": "2017-01-01 00:00:00"   }  ] } { "result": false, "error": "not-found" }

Get single API key Read

Gets a specific API key. In this example we get API key 1. If this API key exists, a result is returned as shown. If this API key does not exist, an error is returned.

Possible results

  • Succes API key found.
  • Error API key not found.

Returned data

  • result Indicates if the request was succesful.
  • id The ID for this API key (for your convenience).
  • data API keys.
    • id Unique identifier for this API key.
    • api_key The key for this API key.
    • api_secret The secret for this API key.
    • title The title for this API key.
    • allowed_host The hostname that is allowed to use this API key.
    • admin Indicates if this is an admin-level API key.
    • date_expire The expire date of this API key.
    • created Timestamp when the API key was created.
    • updated Timestamp when the API key was last updated.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/api_keys/1 { "result": true, "id": 1, "data": [   {   "id": "1",   "api_key": "2cg4lbcQ86FBgjubrcNtvCSNcO6ALo78",   "api_secret": "kePVArQJOqCkzELXfDPQlapQtFhO9D0S",   "title": "Front-end API key",   "allowed_host": "*",   "admin": "0",   "date_expire": "2017-12-31",   "created": "2017-01-01 00:00:00",   "updated": "2017-01-01 00:00:00"   }  ] } { "result": false, "error": "not-found" }

Add API key Create

Add an API key. If the API key is added, a result is returned as shown. If the API key is not added, an error is returned.

Possible results

  • Succes API key added.
  • Error API key not added.

Returned data

  • result Indicates if the request was succesful.
  • id ID of the requested API keys (for your convenience).
  • data Data of the API keys.
    • id Unique identifier for this API key.
    • api_key The key for this API key.
    • api_secret The secret for this API key.
    • title The title for this API key.
    • allowed_host The hostname that is allowed to use this API key.
    • admin Indicates if this is an admin-level API key.
    • date_expire The expire date of this API key.
    • created Timestamp when the API key was created.
    • updated Timestamp when the API key was last updated.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/api_keys { "api_key": "2cg4lbcQ86FBgjubrcNtvCSNcO6ALo78", "api_secret": "kePVArQJOqCkzELXfDPQlapQtFhO9D0S", "title": "Front-end API key", "allowed_host": "*", "admin": "0", "date_expire": "2017-12-31" } { "result": true, "api_key": 1, "data": {   "id": "1",   "api_key": "2cg4lbcQ86FBgjubrcNtvCSNcO6ALo78",   "api_secret": "kePVArQJOqCkzELXfDPQlapQtFhO9D0S",   "title": "Front-end API key",   "allowed_host": "*",   "admin": "0",   "date_expire": "2017-12-31",   "created": "2017-01-01 00:00:00",   "updated": "2017-01-01 00:00:00"   } } { "result": false, "error": "not-found" }

Update API key Update

Updae an API key. If the API key is updated, a result is returned as shown. If the API key is not updated, an error is returned.

Possible results

  • Succes API key updated.
  • Error API key not updated.

Returned data

  • result Indicates if the request was succesful.
  • id ID of the requested API keys (for your convenience).
  • data Data of the API keys.
    • id Unique identifier for this API key.
    • api_key The key for this API key.
    • api_secret The secret for this API key.
    • title The title for this API key.
    • allowed_host The hostname that is allowed to use this API key.
    • admin Indicates if this is an admin-level API key.
    • date_expire The expire date of this API key.
    • created Timestamp when the API key was created.
    • updated Timestamp when the API key was last updated.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/api_keys/1 { "api_key_from":"2017-01-01 00:00:00", "api_key_to": "2017-01-02 00:00:00", "type":"all" } { "result": true, "api_key": 1, "data": {   "id": "1",   "api_key": "2cg4lbcQ86FBgjubrcNtvCSNcO6ALo78",   "api_secret": "kePVArQJOqCkzELXfDPQlapQtFhO9D0S",   "title": "Front-end API key",   "allowed_host": "*",   "admin": "0",   "date_expire": "2017-12-31",   "created": "2017-01-01 00:00:00",   "updated": "2017-01-01 00:00:00"   } } { "result": false, "error": "not-found" }

Delete API keys Delete

Delete an API key by id. In this example we delete the API key with id 1. If the API key is deleted, a result is returned as shown. If the API key is not deleted, an error is returned.

Possible results

  • Succes API key deleted.
  • Error API key not deleted.

Returned data

  • result Indicates if the request was succesful.
  • data Data of the API keys.
    • id Unique identifier for this API key.
    • api_key The key for this API key.
    • api_secret The secret for this API key.
    • title The title for this API key.
    • allowed_host The hostname that is allowed to use this API key.
    • admin Indicates if this is an admin-level API key.
    • date_expire The expire date of this API key.
    • created Timestamp when the API key was created.
    • updated Timestamp when the API key was last updated.
  • error A short description of the error that occurred (only on error).
https://demo.codechecker.io/v1.3/admin/api_keys/1 { "result": true, "data": "1" } { "result": false, "error": "not-found" }