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
- Required
key
: Your API Key - Required
secret
: Your API Secret - Required
timeSlice
: When should be called? read more at timeSlice possible values=================================. - Required
count
: How many cycles should be repeated? read more at count possible values=================================. - Required
url
: The target url that A Trigger will call it at defined TimeSlice. MUST BE URL ENCRYPTED - Semi-Optional
tag_
: You need tag your tasks for future identification and to control them using API in the future. read more at _tags parameters=================================. - [Optional]
retries
: How many times should try if your server failed(or it was down)? default value: 3 - [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:
Call http://example.com/myTask?query=sample every 30 minutes for infinite times: