Not logged in - Login
< back

Library: .Net

We have made a library for .Net to help you start using A Trigger in a minute. This .Net library is made to avoid possible errors in your application. Even if ATrigger.com API server become unavailable, your application will work without any problem. On the other hand, all requests are Async by default and now slowness will happen.


Prerequisites

  1. First you need to follow Quick Start Guide.
  2. You have this personal details from your Account Setup page:
    1. API Key
    2. API Secret
  3. .Net 2+


Step 1: Initialize

Use NuGet to install the library. From the Visual Studio Tools menu, select Library Package Manager and then click Package Manager Console. Run:

Install-Package ATrigger

You only need to initialize once at the start of your program. You can then keep using the ATrigger singleton anywhere in your code.

//Debug-off, Safe for being on product version:
ATrigger.Initialize("YOUR_APIKey", "YOUR_APISecret");

//Debugging-friendly: ATrigger.Initialize("YOUR_APIKey", "YOUR_APISecret", false, true);

In development you might want to use development settings above to start debugging.


Step 2: Start Using, Functions

Create

//Tags: Tags are required to identify tasks. 
//read more at: http://atrigger.com/docs/wiki/9/rest-api-v10-parameter-tag_
Dictionary<string, string> tags = new Dictionary<string, string>();
tags.Add("type", "test");
            
//Create
ATrigger.Client.doCreate(TimeQuantity.Day(), "1", "http://www.example.com/myTask?something", tags);


  1. Required _timeQuantity: Minute, Hour, Day, Month, Year - more info
  2. Required _timeValue: According to the chosen timeQuantity, set the amount of time. "_timeValue + _timeQuantity" will become timeSlice. In the above example: 1day
  3. Required url: The target url that A Trigger will call it at defined TimeSlice. MUST BE URL ENCRYPTED
  4. Semi-OptionalRequired tag_*: You need tag your tasks for future identification and to control them using API in the future. read more at tags_* parameters.
  5. [Optional] retries: How many times should try if your server failed(or it was down)? default value: 3
  6. [Optional] count: How many cycles should be repeated? read more at count parameter.
  7. [Optional] first: When should be the first call? You are not required to set time value by default. read more at first parameter.
  8. [Optional] postData: The dictionary object for the content you want to HTTP POST to your URL when your task has been triggered.


Delete

//Tags:
Dictionary<string, string> tags = new Dictionary<string, string>();
tags.Add("type", "test");
            
//Delete
ATrigger.Client.doDelete(tags);