Not logged in - Login
< back

REST API v1.0 - Create a new task

Here we want to describe how you can make your first task using API.


API URL

https://api.atrigger.com/v1/tasks/create?
    key=APIKEY                     //required
    &secret=APISECRET              //required
    &timeSlice=1month              //required
    &count=12                      //required
    &tag_id=9999                      //semi-optional
    &url=http%3A%2F%2Fexample.com%2FmyTask%3Fquery%3Dsample          //required


All About Parameters

Some queries are required to create a task. More optional parameters are available for advanced usages. Also POST and GET requests to API has different meanings.

Keep in mind you should pass all parameter values URL Encoded.

Parameters: URL Queries

  1. Required key: Your API Key
  2. Required secret: Your API Secret
  3. Required timeSlice: When should be called? read more at timeSlice possible values=================================.
  4. Required count: How many cycles should be repeated? read more at count possible values=================================.
  5. Required url: The target url that A Trigger will call it at defined TimeSlice. MUST BE URL ENCRYPTED
  6. Semi-Optional tag_: You need tag your tasks for future identification. If you want to control them using API in the future, you need to add custom tags to them. read more at _tags parameters=================================.
  7. [Optional] retries: How many times should try if your server failed(or it was down)? default value: 3
  8. [Optional] first: When should be the first call? You are not required to set time value by default. read more at first parameter information=================================.


Parameters: POST Data

This is an optional advanced feature. In a sentence: On task creation using API, Any data you are POSTing to "Create API URL", will be POSTed to your task URL at the time of fire.

You can forward details such as user information and useful data for your task as POST data to A Trigger API. This information will be passed to your task url at the time of fire.

  • Files and images will be ignored.
  • There are some size limits.
  • POST data should be well formated by Keys/Values.


Output / Result

All API requests will return the result in JSON format.

Example result when you have problem in your API Key/Secert:

{ "type": "ERROR", "message": "API Key/Secret is null." }

You can read everything about the outputs at: =================================


Examples

You need to change the API Key, API Secret and URL in this examples.


Call http://example.com/myTask?query=sample each month at this day for a year:

https://api.atrigger.com/v1/tasks/create?key=APIKEY&secret=APISECRET&timeSlice=1month&count=11&url=http%3A%2F%2Fexample.com%2FmyTask%3Fquery%3Dsample


Call http://example.com/myTask?query=sample every 30 minutes for infinite times:

https://api.atrigger.com/v1/tasks/create?key=APIKEY&secret=APISECRET&timeSlice=30minute&count=-1&url=http%3A%2F%2Fexample.com%2FmyTask%3Fquery%3Dsample


Debug

All tasks will be listed in your panel at the moment of creation. Login to your panel and check all tasks available there.