-
Notifications
You must be signed in to change notification settings - Fork 0
Added docs adding profile photos to roles #197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
76d5a75
5ea1cfa
2b36735
45c8228
4274694
deb74dc
07a3727
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
### Agent Object (Version 2) | ||
|
||
Agent objects, Affiliates in TutorCruncher, includes basic user information including fields that are only linked to the Agent Role. | ||
Agent objects, Affiliates in TutorCruncher, includes basic user information including fields that are only linked to the Agent Role. | ||
It includes details about affiliated Clients, `clients`, and their `commission_rate`. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
import requests | ||
|
||
headers = {'Authorization': 'token <API KEY>'} | ||
|
||
data = { | ||
'user': { | ||
'email': '[email protected]', | ||
'last_name': 'Bob' | ||
# ... | ||
}, | ||
# ... | ||
"id": 568433, | ||
"email": "[email protected]", | ||
"last_name": "Bob", | ||
"mobile": "07842 485 204", | ||
"photo": "https://photo_url.com/200/300" | ||
#... | ||
} | ||
|
||
requests.post('...', json=data, headers=headers) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,7 @@ attributes: | |
- | ||
name: photo | ||
type: string | ||
description: URL to access the Contractor's profile photo. | ||
description: URL to access the user's profile photo. | ||
|
||
- | ||
name: extra_attributes | ||
type: array | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ but the data we return will be dependent on the version set on your Branch. See | |
### Other changes include: | ||
* Version 2 allows you to update the role by ID now instead of email or name by posting to the endpoint for that specific role. e.g. to update the Client with ID 1234 I can use post to `secure.tutorcruncher.com/api/clients/1234/` with a dictionary of data to update that client and its related user data. | ||
* Version 2 will not match on a users first and last name. | ||
* Version 2 contains a new field `photo` for all roles containing a URL to the photo of the user. You can update a user's photo by sending a URL to the `photo` field in the request. For more info checkout the [Creating/Updating User](#creating-updating-users) section. | ||
* In Version 1 you could update a role by posting to the list page e.g. `secure.tutorcruncher.com/api/clients/` and update a role based on the email passed. In Version 2 this will return an error as it is expecting to create a user with that email. | ||
* In both Versions, if I have a client with the email `[email protected]` and I post to the list page for contractors with the same email then it will create a new contractor role that is linked to the existing client. | ||
* We no longer send emails about failed requests, the errors are returned when the request fails and should be handled then. | ||
|
Uh oh!
There was an error while loading. Please reload this page.