Add a new participant to a party
Using our API, you can update an existing contract party with new participants. To add new participants to a contract party, follow the steps described in this tutorial.
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 by 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 add a new participant. You can find the contract ID using the contracts endpoint. |
PARTY_ID |
The unique ID of the party in your contract where you want to add a new participant. You can find the party ID using the Get contract parties endpoint. |
Body | |
name
|
The name of the participant you want to add to a party in your contract. |
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.
|
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.
|
Permissions | |
_permissions [object]
|
|
contract:update
|
When set to true, the participant can make changes to the contract. Please read more about permissions here. |
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 POST \
--url https://api.oneflow.com/v1/contracts/10015/parties/353218/participants \
--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": false
},
"signatory": false,
"delivery_channel": "email",
"name": "New participant name"
}
import requests
url = "https://api.oneflow.com/v1/contracts/10015/parties/353218/participants"
payload = {
"_permissions": {"contract:update": False},
"signatory": False,
"delivery_channel": "email",
"name": "New participant name"
}
headers = {
"Accept": "application/json",
"x-oneflow-api-token": "9841f1ee533681c3ea6a438560f2bb6c73b76675",
"x-oneflow-user-email": "[email protected]",
"Content-Type": "application/json"
}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.text)
Expected response
This request will output details about the contract party participant you created in JSON format.
Please see the Contract section in the Data model category for more information about the output.
{
"_links": {
"contract": {
"href": "https://api.oneflow.com/v1/contracts/10015"
},
"party": {
"href": "https://api.oneflow.com/v1/contracts/10015/parties/353218"
},
"self": {
"href": "https://api.oneflow.com/v1/contracts/10015/parties/353218/participants/10015"
}
},
"_permissions": {
"contract:update": true
},
"_private_ownerside": {
"created_time": "2020-06-30T07:15:23+00:00",
"first_visited_time": "2020-06-30T07:15:23+00:00",
"last_visited_time": "2020-08-04T10:14:30+00:00",
"updated_time": "2020-08-04T10:14:30+00:00",
"visits": 5
},
"delivery_channel": "email",
"delivery_status": "success",
"email": "[email protected]",
"id": 10015,
"identification_number": "",
"my_participant": false,
"name": "First Last",
"organizer": false,
"phone_number": "",
"sign_method": "standard_esign",
"sign_state": "signed",
"sign_state_updated_time": "2020-07-09T12:53:54+00:00",
"signatory": true,
"title": "Sales Manager",
"two_step_authentication_method": "none"
}
Response codes
Status | Meaning | Description |
---|---|---|
200 | OK | Returns the contract with the created party. |
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 almost 2 years ago