Skip to content

Commit 0ab855f

Browse files
authored
Merge pull request #197 from tutorcruncher/roles-profile-pic-doc
Added docs adding profile photos to roles
2 parents 61b9469 + 07a3727 commit 0ab855f

13 files changed

+37
-12
lines changed

pages/agents/agent-object-v2.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"latitude": "51.5373258999999990",
1515
"longitude": "-0.1496343000000000",
1616
"date_created": "2020-02-18T16:13:04.193340Z",
17-
"timezone": "Europe/London"
17+
"timezone": "Europe/London",
18+
"photo": "https://secure.tutorcruncher.com/media/photo/65.jpg",
1819
"commission_rate": null,
1920
"clients": [],
2021
"last_updated": "2020-03-16T12:23:39.056867Z",

pages/agents/agent-object-v2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
### Agent Object (Version 2)
22

3-
Agent objects, Affiliates in TutorCruncher, includes basic user information including fields that are only linked to the Agent Role.
3+
Agent objects, Affiliates in TutorCruncher, includes basic user information including fields that are only linked to the Agent Role.
44
It includes details about affiliated Clients, `clients`, and their `commission_rate`.

pages/agents/agent-object-v2.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ attributes:
6161
name: timezone
6262
type: string
6363
description: The user's timezone, accepted values are timezone database values.
64+
-
65+
name: photo
66+
type: string
67+
description: The URL to the Agent's photo.
6468
-
6569
name: commission_rate
6670
type: string

pages/clients/client-object-v2.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"latitude": "51.5249280000000027",
1515
"longitude": "-0.0944689940000000",
1616
"date_created": "2020-01-01T12:00:00.000000Z",
17-
"timezone": null
17+
"timezone": null,
18+
"photo": "https://secure.tutorcruncher.com/media/photo/44bc4e56.jpg",
1819
"status": "live",
1920
"is_taxable": true,
2021
"received_notifications": [

pages/clients/client-object-v2.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ attributes:
6161
name: timezone
6262
type: string
6363
description: The user's timezone, accepted values are timezone database values.
64+
-
65+
name: photo
66+
type: string
67+
description: The URL to the Client's photo.
6468
-
6569
name: status
6670
type: string

pages/contractors/contractor-object-v2.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"longitude": "-0.1370000000000005",
1616
"date_created": "2018-11-22T09:23:55.297608Z",
1717
"timezone": null,
18+
"photo": "https://secure.tutorcruncher.com/media/photo/44bc4e56.jpg",
1819
"status": "approved",
1920
"default_rate": null,
2021
"qualifications": [],

pages/contractors/contractor-object-v2.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ attributes:
6161
name: timezone
6262
type: string
6363
description: The user's timezone, accepted values are timezone database values.
64+
-
65+
name: photo
66+
type: string
67+
description: The URL to the Contractor's photo.
6468
-
6569
name: status
6670
type: string

pages/creating-updating-users/creating-updating-users.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ You can create a user without an email address, however, you will not be able to
66
include the users last name when creating/updating as this field is required. Any other role specific required
77
fields are specified on the endpoint description.
88

9+
Profile photos can be optionally added or updated for all user roles — [Agents](#agents), [Clients](#clients), [Contractors](#contractors), and [Recipients](#recipients) — by including a `photo` field with a valid image URL when creating or updating a user. If the image is valid and accessible, it will be downloaded, processed into thumbnails, and included in the response. If the `photo` field is omitted during an update, the current photo remains unchanged. To remove an existing photo, set the `photo` field to `null`. Invalid, corrupted, or inaccessible image URLs will result in a `400 Bad Request` with an appropriate error message.
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import requests
22

33
headers = {'Authorization': 'token <API KEY>'}
4+
45
data = {
5-
'user': {
6-
'email': '[email protected]',
7-
'last_name': 'Bob'
8-
# ...
9-
},
10-
# ...
6+
"id": 568433,
7+
"email": "[email protected]",
8+
"last_name": "Bob",
9+
"mobile": "07842 485 204",
10+
"photo": "https://photo_url.com/200/300"
11+
#...
1112
}
13+
1214
requests.post('...', json=data, headers=headers)

pages/recipients/recipient-object-v2.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"latitude": "51.5249280000000027",
1515
"longitude": "-0.0944689940000000",
1616
"date_created": "2019-11-24T16:11:48.312507Z",
17-
"timezone": null
17+
"timezone": null,
18+
"photo": "https://secure.tutorcruncher.com/media/photo/44bc4e56.jpg",
1819
"default_rate": null,
1920
"paying_client": {
2021
"id": 3,

0 commit comments

Comments
 (0)