Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
api:api_applicants_trackers [2014/06/25 10:19] – created Lauri Elevantapi:api_applicants_trackers [2021/01/21 12:51] (current) – external edit 127.0.0.1
Line 15: Line 15:
   Content-Type: application/json   Content-Type: application/json
   Content-Length: 1234   Content-Length: 1234
- + 
 +==== Response example ==== 
 + 
 +  
 +    "1":
 +        "created": "2014-06-25T11:09:37+00:00", 
 +        "code": "FAIR", 
 +        "notes": "Some notes", 
 +        "reduction": null 
 +    }, 
 +    "3":
 +        "created": "2014-06-25T16:47:24+00:00", 
 +        "code": "INTERNET", 
 +        "notes": "Some notes", 
 +        "reduction":
 +            "reduction": "Percent", 
 +            "percent": 20 
 +        } 
 +    }, 
 +     
 +  } 
 + 
 + 
 +===== POST ===== 
 + 
 +Add a new tracker using any text (2 to 16 characters) as the tracker code. The URI for the tracker created is returned in the ''Location'' header. 
 + 
 +If a tracker with this code exists, a ''409 Conflict'' will be returned, along with the URI of the offending tracker in the ''Location'' header. 
 + 
 +**This method simply creates a new tracker, but does not assign it to any applicants.** You can later ''PUT'' the tracker to any number of applicants using ''PUT'' [[api:api_applicants_id_trackers_id|/api/applicants/ID/trackers/ID]]. 
 + 
 +==== Syntax ==== 
 + 
 +  POST /api/applicants/trackers 
 +  Host: apply.example.edu 
 +  Authorization: DREAM apikey="..." 
 +   
 +==== Parameters ==== 
 + 
 +^ Name ^  ^ Description ^ 
 +| ''code'' | **Required** | This is the unique tracker code, should be easily recognisable. 2 to 16 characters. | 
 +| ''notes'' | **Required** | This text will be used to additionally explain the meaning of the tracker code. 2 to 200 characters. | 
 + 
 +==== Response headers ==== 
 + 
 +  Content-Type: application/json 
 +  Content-Length:
 +  Location: /api/applicants/trackers/TEST 
 + 
 +==== Response codes ==== 
 + 
 +| ''201 Created'' | New tracker was created | 
 +| ''409 Conflict'' | A tracker with this code already exists |