CountdownMail API

The CountdownMail API provides the means to manage countdown timers.

API Conventions

  • /something is equivalent to /something/.

  • URL paths, URL query parameter names, and JSON field names are case sensitive.

  • URL paths use lower case, with dashes separating words.

  • Query parameters and JSON fields use lower case, with underscores separating words.

  • The HTTP status indicates whether an operation failed or succeeded, with extra information included in the HTTP response body.

  • All APIs return standard error code formats.

  • Unexpected query parameters are ignored.

  • Unexpected JSON fields in the request body are ignored.

  • The JSON number type is bounded to a signed 32-bit integer.

API Endpoint


 https://countdownmail.com/api
    

Authentication

  • To authenticate with the APIs, specify the "Authorization" header with each request. The value of the Authorization header must be a valid API key or basic auth with the API key as username and an empty password. Get a CountdownMail API key.

  • For examples of supplying the Authorization header, refer to the cURL example below or any of the individual API request examples.

Using Postman

If you use Postman you can click the following button to import the CountdownMail API as a collection:

Run in Postman

Using cURL

If you are using cURL to call the API, you must include the resource URI in quotes when you pass in multiple query parameters separated by an &.

For example:

curl -v \
-H "Content-Type: application/json" \
-H "Authorization: wEw476d2e5b1d2bad079bf" \
-X GET "https://countdownmail.com/api/deactivate/1g"

Errors

When you make an API call you may receive an error message in response. Either there is something wrong with your request or something went wrong on our end. Errors respond with an error code and JSON that contains a more precise message.

Code Status Name Description Suggested Action
400 Bad Request There is a problem with your request. Check your request follows the API documentation and uses correct syntax.
401 Unauthorized You don’t have the needed authorization to make the request. Make sure you are using a valid API key.
404 Not Found The server couldn’t find the requested file. Change your request URL to match a valid API endpoint.
405 Method Not Allowed The resource does not have the specified method. Change the method to follow the documentation for the resource.
500 Internal Server Error Something went wrong on our end. Try the request again later. If the error does not resolve, contact support.
503 Service Unavailable We are experiencing higher than normal levels of traffic. Try the request again.


Example Error (HTTP status code: 401)

{
    "status": "error",
    "message": "Unauthorized"
}


Countdown Timer Create

POST /create

Using Postman

If you use Postman you can click the following button to import the CountdownMail API as a collection:

Run in Postman

These are the valid request options for Create a countdown timer:

Field Type Description Required Notes
skin_id integer Skin id yes Valid values in range 1 - 9
name string Name of the countdown timer yes Maximum length - 100 bytes. Example: Big Sale!
time_end string Datetime in format of YYYY-MM-DD HH:MM:SS. yes Example: 2016-07-24 20:00:00
time_zone string Standard timezone identification string. yes Example: America/New_York.
font_family string Font Family name no Example: Roboto-Bold See all
color_primary string Hex color code no Example: 9c0000
color_text string Hex color code no Example: cc0000
color_bg string Hex color code no Example: FFFFFF
lang_local integer Whether or not to use the dynamically adapts to the local language. no This feature is available with any of our premium plans.
font_size integer Font Size no Valid values in range 14 - 73
day integer Whether or not to use the days. no Valid values in range 0 - 1
lang string ISO 2 Letter Language Codes no Valid values are "ar", "zh", "fa", "he", "hi", "ko", "th", "el", "bg", "cs", "da", "de", "en", "es", "fr", "it", "hu", "nl", "no", "pl", "pt", "ru", "sk", "fi", "sv", "tr", "vi"

Examples

Request: POST /create

{
    "skin_id":3,
    "name":"Big Sale!",
    "time_end":"2017-02-01 20:00:00",
    "time_zone":"America\/Los_Angeles",
    "font_family":"Roboto-Bold",
    "color_primary":"FF3A43",
    "color_text":"FFFFFF",
    "color_bg":"000000",
    "lang_local":"0",
    "font_size":"38",
    "day":"1",
    "lang":"en"
}

Response: (HTTP status code: 200)

{
    "status": "success",
    "message": {
        "code": "1j",
        "src": "http://i.cdngif.com/td.gif"
}

Countdown Timer Update

POST /update/{code}

URI Parameters
{code}(required)  

Countdown Timer code

Example: 1j

Using Postman

If you use Postman you can click the following button to import the CountdownMail API as a collection:

Run in Postman

Valid request options for update a countdown timer see here

Countdown Timer Duplicate

POST /duplicate/{code}

URI Parameters
{code}(required)  

Countdown Timer code

Example: 1j

Using Postman

If you use Postman you can click the following button to import the CountdownMail API as a collection:

Run in Postman

Valid request options for duplicate a countdown timer see here

Countdown Timer Create Modifier

POST /createmodifier/{code}

URI Parameters
{code}(required)  

Countdown Timer code

Example: 1j

Using Postman

If you use Postman you can click the following button to import the CountdownMail API as a collection:

Run in Postman

Valid request options for Create Modifier

Field Type Description Required Notes
time_end string Datetime in format of YYYY-MM-DD HH:MM:SS. yes Example: 2016-07-24 20:00:00
time_zone string Standard timezone identification string. yes Example: America/New_York.

Examples

Request: POST /createmodifier/16c

{
    "time_end":"2016-12-16 20:00:00",
    "time_zone":"America\/Los_Angeles"
}

Response: (HTTP status code: 200)

{
    "status": "success",
    "message": {
        "modifier_id": "2489",
        "src": "http://i.cdngif.com/16c.gif?m=2489"
        }
}

Countdown Timer Deactivate

GET /deactivate/{code}

URI Parameters
{code}(required)  

Countdown Timer code

Example: 1j

Using Postman

If you use Postman you can click the following button to import the CountdownMail API as a collection:

Run in Postman

Countdown Timer Activate

GET /activate/{code}

URI Parameters
{code}(required)  

Countdown Timer code

Example: 1j

Using Postman

If you use Postman you can click the following button to import the CountdownMail API as a collection:

Run in Postman