You only need a few things to get started sending Contracts via the REST API:
- A PactSafe account with REST API access. Looking to test first? Request a developer account here.
- You'll need to create an API key in your PactSafe profile here. All REST API calls require authentication.
- You'll need to create & publish a Contract in PactSafe and get the ID (it's the integer in the URL). Learn more on that here.
There are 3 steps required for sending Contracts:
- Contract Created and Published
- Create a Request
- Send a Request
What's a "Request"?
A Request encompasses the entire experience of sending contracts to a Signer, including but not limited to: who receives the contracts, where they are sent, and which contracts get sent.
Create a Request
To create a request, you'll do a POST
to https://api.pactsafe.com/v1.1/sites/:id/requests
with a JSON request body, similar to the following:
{
"name": "My Request Name!",
"contracts": [1],
"signers": [
{
"signer_id": "[email protected]",
"signer": {
"email": "[email protected]",
"mobile_number": "317-123-1234",
"additional_attributes": {
"first_name": "Test",
"last_name": "Test"
}
},
"send_to": {
"email": true, // true if you want them to receive by email
"mobile_number": true // true if you want them to also receive an sms asking for acceptance
}
}
]
}
Once you have done the POST
, you will receive back a response body containing the full request, including other default properties as part of a typical Request. You'll want to retrieve the id
of the response body to move onto the next step....sending!
Send a Request
To send a request, it's as simple as doing a POST
to https://api.pactsafe.com/v1.1/requests/:request_id/send
.
Contracts Must be Published (i.e. not a draft)
Please make sure that the contracts you plan on sending are published prior to creating the Request.
Updated 3 months ago