REST API v1.0 - Function: Create a new task
Here we want to describe how you can make your first task using API.
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 ParametersSome 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.
Parameters: URL Queries
key: Your API Key
secret: Your API Secret
timeSlice: When should be called? read more at timeSlice parameter.
count: How many cycles should be repeated? read more at count parameter.
url: The target url that A Trigger will call it at defined TimeSlice. MUST BE URL ENCRYPTED
tag_*: You need tag your tasks for future identification and to control them using API in the future. read more at tags_* parameters.
retries: How many times should try if your server failed(or it was down)? default value: 3
first: When should be the first call? You are not required to set time value by default. read more at first parameter.
Parameters: POST DataThis 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 / ResultAll API requests will return a JSON result.
Example result when you have problem in your API Key/Secert:
"type": "ERROR", "message": "API Key/Secret is null." }
You can read more about the outputs at: http://atrigger.com/docs/wiki/11/rest-api-v10-outputs
ExamplesYou need to change the API Key, API Secret and URL in this examples.