User:Brett Wuth/Running Notes/2016-04
From PCSAR
(→2016-04-02) |
(→2016-04-02) |
||
Line 27: | Line 27: | ||
https://api.ca.d4h.org/v2/documentation#!/{activities}/v2teamactivities_post_1 | https://api.ca.d4h.org/v2/documentation#!/{activities}/v2teamactivities_post_1 | ||
+ | |||
+ | |||
+ | post /v2/team/{activities} | ||
+ | |||
+ | Create an activity | ||
+ | <pre> | ||
+ | Parameters | ||
+ | Parameter Value Description Parameter Type Data Type | ||
+ | activities | ||
+ | path string | ||
+ | access_token Bearer authentication token query string | ||
+ | ref Unique code for report form string | ||
+ | title Title of report form string | ||
+ | "Test exercise 2" | ||
+ | |||
+ | activity | ||
+ | The type of the activity form string | ||
+ | "exercise" | ||
+ | |||
+ | date Start of when activity happened form date | ||
+ | "2013-01-02T16:00:00.000Z" | ||
+ | |||
+ | enddate Time when activity ended form date | ||
+ | "2013-01-02T16:00:00.000Z" | ||
+ | |||
+ | description Description of the activity form string | ||
+ | streetaddress Street address of the activity location form string | ||
+ | townaddress Town address of the activity location form string | ||
+ | regionaddress Reagion address of the activity location form string | ||
+ | postcodeaddress Post Code address of the activity location form string | ||
+ | countryaddress Country in which the activity was based in form string | ||
+ | lat Lattitude address of the activity location form number | ||
+ | lng Longitude address of the activity location form number | ||
+ | distance Distance from base form number | ||
+ | </pre> | ||
+ | |||
+ | Request URL | ||
+ | |||
+ | https://api.ca.d4h.org:443/v2/team/exercises | ||
+ | |||
+ | Response Body | ||
+ | |||
+ | { | ||
+ | "statusCode": 200, | ||
+ | "data": { | ||
+ | "id": 34673, | ||
+ | "team_id": 332, | ||
+ | "tracking_number": null, | ||
+ | "published": 0, | ||
+ | "date": "2013-01-02T16:00:00.000Z", | ||
+ | "pretasked": 0, | ||
+ | "tasked_mobile": 0, | ||
+ | "enddate": "2013-01-01T16:00:00.000Z", | ||
+ | "ref": "08975 Test exercise 2", | ||
+ | "ref_autoid": "08975", | ||
+ | "ref_desc": "Test exercise 2", | ||
+ | "description": "", | ||
+ | "plan": null, | ||
+ | "location_bookmark_id": null, | ||
+ | "latlng": null, | ||
+ | "lat": null, | ||
+ | "lng": null, | ||
+ | "distance": 0, | ||
+ | "bearing": null, | ||
+ | "activity": "exercise", | ||
+ | "perc_attendance": 0, | ||
+ | "count_attendance": 0, | ||
+ | "count_guests": 0, | ||
+ | "night": 0, | ||
+ | "streetaddress": "", | ||
+ | "townaddress": "", | ||
+ | "regionaddress": "", | ||
+ | "postcodeaddress": "", | ||
+ | "countryaddress": "", | ||
+ | "gridref": "" | ||
+ | }, | ||
+ | "meta": {} | ||
+ | } | ||
+ | |||
+ | Response Code | ||
+ | |||
+ | 200 | ||
+ | |||
+ | Response Headers | ||
+ | |||
+ | { | ||
+ | "Date": "Sat, 02 Apr 2016 20:36:16 GMT", | ||
+ | "Vary": "origin,accept-encoding", | ||
+ | "Access-Control-Allow-Origin": "*", | ||
+ | "Access-Control-Max-Age": "86400", | ||
+ | "Access-Control-Allow-Methods": "GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS", | ||
+ | "Access-Control-Allow-Headers": "Authorization, Content-Type, If-None-Match", | ||
+ | "Access-Control-Expose-Headers": "WWW-Authenticate, Server-Authorization", | ||
+ | "Content-Type": "application/json; charset=utf-8", | ||
+ | "Cache-Control": "no-cache", | ||
+ | "Content-Encoding": "gzip", | ||
+ | "Strict-Transport-Security": "max-age=15768000", | ||
+ | "Keep-Alive": "timeout=15, max=100", | ||
+ | "Connection": "Keep-Alive", | ||
+ | "Transfer-Encoding": "chunked" | ||
+ | } |
Revision as of 20:51, 2 April 2016
2016-04-02
https://pcsar.ca.d4h.org/team/settings
Turned off the following modules which we don't use. By having them off hope to simplify user interface and avoid potential use by members that don't understand how we are integrating data with that on the wiki.
https://pcsar.ca.d4h.org/team/settings/modules/communication
https://pcsar.ca.d4h.org/team/settings/modules/collaboration
https://pcsar.ca.d4h.org/team/settings/modules/equipment
https://pcsar.ca.d4h.org/team/settings/modules/resources
https://pcsar.ca.d4h.org/team/settings/modules/whiteboard
Other modules
https://pcsar.ca.d4h.org/team/settings/custom-fields/exercise
Deleted D4HExerciseID -- it's implicit in the URL. Duplication as a custom user field is unnecessary and creates a potential area for data to be out of sync.
https://api.ca.d4h.org/v2/documentation#!/{activities}/v2teamactivities_post_1
post /v2/team/{activities}
Create an activity
Parameters Parameter Value Description Parameter Type Data Type activities path string access_token Bearer authentication token query string ref Unique code for report form string title Title of report form string "Test exercise 2" activity The type of the activity form string "exercise" date Start of when activity happened form date "2013-01-02T16:00:00.000Z" enddate Time when activity ended form date "2013-01-02T16:00:00.000Z" description Description of the activity form string streetaddress Street address of the activity location form string townaddress Town address of the activity location form string regionaddress Reagion address of the activity location form string postcodeaddress Post Code address of the activity location form string countryaddress Country in which the activity was based in form string lat Lattitude address of the activity location form number lng Longitude address of the activity location form number distance Distance from base form number
Request URL
https://api.ca.d4h.org:443/v2/team/exercises
Response Body
{
"statusCode": 200, "data": { "id": 34673, "team_id": 332, "tracking_number": null, "published": 0, "date": "2013-01-02T16:00:00.000Z", "pretasked": 0, "tasked_mobile": 0, "enddate": "2013-01-01T16:00:00.000Z", "ref": "08975 Test exercise 2", "ref_autoid": "08975", "ref_desc": "Test exercise 2", "description": "", "plan": null, "location_bookmark_id": null, "latlng": null, "lat": null, "lng": null, "distance": 0, "bearing": null, "activity": "exercise", "perc_attendance": 0, "count_attendance": 0, "count_guests": 0, "night": 0, "streetaddress": "", "townaddress": "", "regionaddress": "", "postcodeaddress": "", "countryaddress": "", "gridref": "" }, "meta": {}
}
Response Code
200
Response Headers
{
"Date": "Sat, 02 Apr 2016 20:36:16 GMT", "Vary": "origin,accept-encoding", "Access-Control-Allow-Origin": "*", "Access-Control-Max-Age": "86400", "Access-Control-Allow-Methods": "GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS", "Access-Control-Allow-Headers": "Authorization, Content-Type, If-None-Match", "Access-Control-Expose-Headers": "WWW-Authenticate, Server-Authorization", "Content-Type": "application/json; charset=utf-8", "Cache-Control": "no-cache", "Content-Encoding": "gzip", "Strict-Transport-Security": "max-age=15768000", "Keep-Alive": "timeout=15, max=100", "Connection": "Keep-Alive", "Transfer-Encoding": "chunked"
}