Skip to content

Commit 97a613d

Browse files
committed
dans comments
1 parent 1441a8a commit 97a613d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

pages/contractors/update-a-contractor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
'extra_attrs': {'user_dob': '1993-06-23'}
99
# ...
1010
}
11-
r = requests.post('https://secure.tutorcruncher.com/api/contractors/', json=data, headers=headers)
11+
r = requests.post('https://secure.tutorcruncher.com/api/contractors/<id>/', json=data, headers=headers)
1212
pprint.pprint(r.json())

pages/recipients/update-a-recipient.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
'extra_attrs': {'user_dob': '1993-06-23'},
99
# ...
1010
}
11-
r = requests.post('https://secure.tutorcruncher.com/api/recipients/', json=data, headers=headers)
11+
r = requests.post('https://secure.tutorcruncher.com/api/recipients/<id>/', json=data, headers=headers)
1212
pprint.pprint(r.json())

pages/versioning/versioning.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ data in a request to TutorCruncher you will still be able to use the 'user' dict
99
but the data we return will be dependent on the version set on your Branch. See difference ->
1010

1111
### Other changes include:
12-
* 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 or put to `secure.tutorcruncher.com/api/clients/1234/` with a dictionary of data to update that client and its related user data.
12+
* 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.
1313
* Version 2 will not match on a users first and last name.
1414
* 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.
1515
* 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.
@@ -18,7 +18,7 @@ but the data we return will be dependent on the version set on your Branch. See
1818
### Recommendations for using Version 2:
1919
* Retrieve: Use a GET request to the detail page for an individual role (e.g. `secure.tutorcruncher.com/api/clients/<role_id>/`)
2020
* Create: Use a POST request to the list page for each role (e.g. `secure.tutorcruncher.com/api/clients/`)
21-
* Update: Use a POST or PUT request to the detail page for an individual role (e.g. `secure.tutorcruncher.com/api/clients/<role_id>/`)
21+
* Update: Use a POST request to the detail page for an individual role (e.g. `secure.tutorcruncher.com/api/clients/<role_id>/`)
2222
* Delete: Use a DELETE request to the detail page for an individual role (e.g. `secure.tutorcruncher.com/api/clients/<role_id>/`)
2323

2424
Note that the rest of the docs have been updated to reflect Version 2 usage. While you can still use Version 1 until the 3rd July 2025

0 commit comments

Comments
 (0)