Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
api:api_reports_reportname [2014/06/19 17:39] – [Response headers] Lauri Elevantapi:api_reports_reportname [2021/01/21 12:51] (current) – external edit 127.0.0.1
Line 3: Line 3:
 ===== HEAD, GET ===== ===== HEAD, GET =====
  
-List applicants using the filters set as parametersThe number of applicants is represented in the ''X-Count'' header - use the ''HEAD'' request to simply count the number of applicants matching the filters. Use the ''GET'' request to actually fetch them.+The the report's contents as CSV dataYou may use the ''HEAD'' verb to see the size of the CSV data if you want to decide if it is worth downloading it.
  
 ==== Syntax ==== ==== Syntax ====
Line 15: Line 15:
 Each report will require a different set of parameters. If any one of them is not properly set, an error will be returned, listing the unset parameters. Use this functionality to learn which report will require which parameter. Each report will require a different set of parameters. If any one of them is not properly set, an error will be returned, listing the unset parameters. Use this functionality to learn which report will require which parameter.
  
-| ''?commenceYear'' | //See above// | Year number, representing the intake season to use | 
-| ''?comparedYear'' | //See above// | Same as above, used for reports that compare two seasons | 
-| ''?institutions'' | //See above// | A space or comma separated list of [[api:api_institutions|institution ID-s]] | 
-| ''?courses'' | //See above// | A space or comma separated list of [[api:api_courses|course ID-s]] | 
-| ''?regions'' | //See above// | A space or comma separated list of [[api:api_regions|region ID-s]] | 
  
 +^ Name ^ Required ^ Description ^ Notes ^
 +| ''commenceYear'' | //See above// | Year number, representing the intake season to use | |
 +| ''comparedYear'' | //See above// | Same as above, used for reports that compare two seasons | |
 +| ''institutions'' | //See above// | List of [[api:api_institutions|institution ID-s]] | [1] |
 +| ''courses'' | //See above// | List of [[api:api_courses|course ID-s]] | [1] |
 +| ''regions'' | //See above// | List of [[api:api_regions|region ID-s]] | [1] |
 +
 +  * // Note [1]: Lists can be either comma or space separated.//
 ==== Response headers ==== ==== Response headers ====
  
-  Content-Type: text/csv +  Content-Type: text/csv; charset=utf-8 
-  Content-Length: 1456+  Content-Length: 12345
   Content-Disposition: attachment; filename="Registrations-2014-02-12T15:19:21+00:00.csv"   Content-Disposition: attachment; filename="Registrations-2014-02-12T15:19:21+00:00.csv"
 +  Last-Modified: Tue, 01 Jul 2014 16:35:19 GMT
 +  Expires: Tue, 01 Jul 2014 16:53:36 GMT
 +
 +Note that the ''Expires'' and ''Last-Modified'' headers can be used to assess the need to fetch a fresh copy of the data. **If a new request is issued before ''Expires'', then the same data is guaranteed to be returned**, hence making such unintelligent polling useless.