Assigning homework to a Client while they are already in a Session.
A Care Provider can assign homework to their Client. To do so, they need to have an active Session with them. If they don't have any active sessions, they first have to create a Session for their Client using API:(How to Creating a Session by a Care Provider (and assigning homework)).
1- Request URL:
https://gwidev.eq.optt.ca/gateway/profile/caregiver/session/assignment
2- Request Method Type:
PUT
2- Request Method Type:
PUT
3- Request Input Parameters:
Body:
{
"bookIds": [
0
],
"endDate": "string",
"endTime": "string",
"remindDates": [
{
"date": "string",
"time": "string"
}
],
"sessionId": 0,
"startDate": "string",
}
Body Description:
Parameter Name | Parameter Type | Description |
---|---|---|
bookIds | List | List of Assignments that the Client should complete |
startDate | String | Beginning date of the Assignment [yyyy/mm/dd] |
startTime | String | Beginning time of the Assignment [HH:mm] |
endDate | String | Ending date of the Assignment [yyyy/mm/dd] |
endTime | String | Ending time of the Assignment [HH:mm] |
sessionId | Long | Refers to the Session that the Care Provider and Client are in. |
A complete example of an API call:
curl -X PUT "https://gwidev.eq.optt.ca/gateway/profile/caregiver/session/assignment" -H "accept: */*" -H "Authorization: bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjM3NTgyMDY1MjEsInVzZXJfbmFtZSI6ImxhbGVoZGVobmF2aS5sZEBnbWFpbC5jb20iLCJhdXRob3JpdGllcyI6WyJDQVJFR0lWRVIiXSwianRpIjoiOTZhYWFjOTMtMmRjNy00NDM5LWE3YTUtNWI0MzAwYmNjN2NlIiwiY2xpZW50X2lkIjoib3B0dC0wMmVlNzdkYy1hYzQ1LTQzNDQtODE3ZS0xN2NhNTJiNThiNWQiLCJzY29wZSI6WyJyZWFkIiwid3JpdGUiXX0.cvGtZ8jjyREqzFr2kUOhh4HTDsJOD0Y4icAO9KOt42Z_B_HngqylOs_WbDiSKduObzvfTHraDqEIxZJtAzK9YujjKcy9uKfPH_9GR-qcuFNrlrJMREib2AMzUXi9Gsqgh-hNsp1uNhlQzQuzSoKo1rAnuF6HC2m1BU77cbVnrwTdbP6e8jJz21dvav1JSUVZiqiyxVbUY2f8IA8n-sXf_284-4shnkkggbgIPTW88Jd_UOp-w2UZ-lKRWfRmKlhRVM37iamWw0hGOIW3jOJc6_fc1ce-I2O7YYBNkYdwLooBaVzXG0ja8w1PTrHBml95PcmzDLp2zg-4CRpjczSk4g" -H "offset: 1" -H "Content-Type: application/json" -d "{ \"bookIds\": [ 3 ], \"endDate\": \"2021-01-22\", \"endTime\": \"15:50\", \"remindDates\": [ { \"date\": \"2021-01-18\", \"time\": \"15:52\" } ], \"sessionId\": 797, \"startDate\": \"2021-01-16\", \"startTime\": \"15:33\"}"
4- Response:
In case of success, this API will send a 200 ok; and in case of failure, the response follows the general rest error model.
Important Point: If you do not provide enough information for this API you’ll get a 404 error code.
{
"message": "Assignments successfully added to the session"
}