Update a participant in a contract
Updating participant attributes
Using the PUT /contracts/{contract_id}/parties/{party_id}/participants/{participant_id}
endpoint, you can update attributes of an existing participant in a contract.
Currently, you can update the following attributes of an existing participant:
_permissions
delivery_channel
email
identification_number
name
phone_number
sign_method
signatory
title
two_step_authentication_method
.
Note:
If you run the PUT request with an empty request body,
{}
, the request won't update the specified participant.
Note:
The owner-side participants cannot update the
Step 1. Obtain necessary information
To run the script described in this step, you’ll need the following data:
Headers | |
x-oneflow-api-token |
You will only be able to run the script using a valid API token. You can create an API token in the Oneflow web application. Find out more in the Authentication section. |
x-oneflow-user-email |
Your Oneflow user account email. |
Path parameters | |
CONTRACT_ID |
The unique ID of the contract where you want to update the participant. You can find the contract ID using the contracts endpoint. |
PARTY_ID |
The unique ID of the participant's party. You can find the party ID using the Get parties endpoint. |
PARTICIPANT_ID |
The unique ID of the participant you need to update. You can find the participant ID using the Get a party by ID endpoint. |
Body | |
_permissions [object] |
|
contract:update |
When set to true, the participant can make changes to the contract. Please read more about permissions here. |
delivery_channel |
Defines the channel that the system will use to send contract-related notifications to the participant. Select this attribute only based on the selected template’s available options. To learn more about delivery_channel types, please see Delivery channels. |
email |
The participant's email attribute is mandatory based on the delivery_channel and two_step_authentication_method, e.g., if the delivery channel is email , then the participant's email is required. |
identification_number | The date of birth, SSN, personal number, etc., of the participant. |
name |
The participant's name. |
phone_number |
The participant's phone_number attribute is mandatory based on the delivery_channel and two_step_authentication_method, e.g., if the delivery channel is sms , then the participant's phone_number attribute is required. |
sign_method |
Shows the selected method of signing the contract. One of the Sign methods. |
signatory |
Indicates if the participant can sign the contract. |
title |
The title of the participant. |
two_step_authentication_method |
Shows the selected two-step authentication methods. One of the Two-step authentication method options. |
Step 2. Run the code
Replace the values of the parameters in the following command with the actual data from your account and run it:
curl --request PUT \
--url https://api.oneflow.com/v1/contracts/100109/parties/360190/participants/180219 \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'x-oneflow-api-token: 9841f1ee533681c3ea6a438560f2bb6c73b76675' \
--header 'x-oneflow-user-email: [email protected]' \
--data '
{
"_permissions": {
"contract:update": true
},
"email": "[email protected]",
"identification_number": "19340410-1473",
"name": "John Doe II",
"phone_number": "+46 8 517 297 70",
"signatory": false,
"title": "Vice President - Sales"
}'
import requests
url = "https://api.oneflow.com/v1/contracts/100109/parties/360190/participants/180219"
payload = {
"_permissions": {
"contract:update": True
},
"email": "[email protected]",
"identification_number": "19340410-1473",
"name": "John Doe II",
"phone_number": "+46 8 517 297 70",
"signatory": False,
"title": "Vice President - Sales"
}
headers = {
"Accept": "application/json",
"x-oneflow-api-token": "9841f1ee533681c3ea6a438560f2bb6c73b76675",
"x-oneflow-user-email": "[email protected]",
"Content-Type": "application/json"
}
response = requests.request("PUT", url, json=payload, headers=headers)
print(response.text)
Expected response
{
"_links": {
"contract": {
"href": "https://api.oneflow.com/v1/contracts/100109"
},
"party": {
"href": "https://api.oneflow.com/v1/contracts/100109/parties/360190"
},
"self": {
"href": "https://api.oneflow.com/v1/contracts/100109/parties/360190/participants/180219"
}
},
"_permissions": {
"contract:update": true
},
"_private_ownerside": {
"created_time": "2022-08-09T12:45:03+00:00",
"first_visited_time": null,
"last_visited_time": null,
"updated_time": "2022-08-12T05:34:31+00:00",
"visits": 0
},
"delivery_channel": "email",
"delivery_status": "success",
"email": "[email protected]",
"id": 180219,
"identification_number": "19340410-1473",
"my_participant": false,
"name": "John Doe II",
"organizer": false,
"phone_number": "+46 8 517 297 70",
"sign_method": "standard_esign",
"sign_state": "undecided",
"sign_state_updated_time": null,
"signatory": false,
"title": "Vice President - Sales",
"two_step_authentication_method": "none"
}
Response codes
Status | Meaning | Description |
---|---|---|
200 | OK | Returns the updated participant. |
400 | Bad Request | Invalid format or content of the request. |
401 | Unauthorized | The API token or the user email is invalid. |
403 | Forbidden | The request is not authorized by the server. |
404 | Not Found | A required entity is missing. |
409 | Conflict | A conflict occurred with the current state of the target resource. |
Updated about 2 years ago