Create an Agreement with the EraCLM API
You can create an agreement, populate tags, and send the agreement to negotiation via the EraCLM API. After the agreement has been accepted and signed, download the agreement as PDF by using the EraCLM API. See the EraCLM API Reference for a list of all endpoints available.
For this quickstart guide, you'll need:
- The EraCLM URL:
https://company.eraclm.com
- Your api_key:
your-email@yourcompany.com
- Your EraCLM secret:
ac4e32cd8d3fc71e8c630fc127ade9a5e92c64a
The EraCLM api_key is the email account that you use to log in to EraCLM. The EraCLM secret is configured by a system admin to enable your user account to use the EraCLM API.
1 Authenticate and Generate a Token
Use this endpoint to authenticate on the EraCLM API. After you authenticate, include the token as an authorization header.
curl -X 'POST' \ 'https://company.eraclm.com/rest/v2/obtain-token/' \ -H 'accept: application/json' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -d 'secret=ac4e32cd8d3fc71e8c630fc127ade9a5e92c64a&api_key=your-email@yourcompany.com'
Example response:
{ "token": "c302dcd552e7c60b9d1a17765d80104308ab8d64", "expire": "2022-03-18T16:58:49.998", "roles": [ 200, 300, 100 ] }
The token expires after 30 minutes. You must include the token in all subsequent calls as an authorization header as in the example.
curl --location --request GET 'https://company.eraclm.com/rest/v2/agreement/70218/content/' \ --header 'Authorization: token c302dcd552e7c60b9d1a17765d80104308ab8d64'
2 Create a Request
This endpoint creates a new draft agreement as a request.
curl -X 'POST' \ 'https://company.eraclm.com/rest/v2/request' \ -H 'accept: application/json' \ -H 'X-API-Key: c302dcd552e7c60b9d1a17765d80104308ab8d64' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -d 'name=Agreement%20name&framework=Acme,%20Inc.%20-%20Contract%20Agreement%20Form'
Parameter | Description |
---|---|
name: string | The agreement name |
framework: string | The framework name, for example: Acme, Inc. - Contract Agreement Form |
Example response:
{ "id": "6088473c1ac8c4034a130f0c", "cid": 882, "name": "Agreement Name", "collaboration_type": "q", "collaboration_type_name": "Always Counterparty with queueing", "framework": 881, "parent": null, "status": null, "team": { "team_id": 0, "controller": { "id": 39, "email": "your-email@mourcompany.com", "full_name": "John Doe", "first_name": "John", "last_name": "Doe", "avatar": null }, "members": [ { "id": 39, "user": { "id": 39, "email": "your-email@your-company.com", "full_name": "John Doe", "first_name": "John", "last_name": "Doe", "avatar": null }, "mongo_contract": "6088473c1ac8c4034a130f0c", "is_controller": true, "is_signer": null, "role_confirmed": false, "color": "#9D248F" } ] }, "counterparties": [], "created": "2021-12-27T17:17:48.728040Z" }
The following table describes some fields in the response.
Variable | Description |
---|---|
id: string | Agreement primary identifier |
cid: integer | Agreement secondary identifier, also known as the agreementCID |
name: string | Agreement name |
framework: integer | The framework CID |
status: string | Agreement status |
team: object | Team 0 metadata |
The following table describes all the agreement status.
Agreement Status | Meaning |
---|---|
d | Draft |
n | Negotiation |
s | Signing |
g | Signed |
e | Verified |
c | Closed |
a | Cancelled |
w | Withdrawn |
Use the agreementCID
for the next steps.
3 Populate tags with values
Once you create the agreement, enter values for the tags. First, you need the list of tags and the type of values that they need, use:
curl -X 'GET' \ 'https://company.eraclm.com/rest/v2/agreement/882/tag/' \ -H 'accept: application/json' \ -H 'X-API-Key: c302dcd552e7c60b9d1a17765d80104308ab8d64'
Example response:
{ "meta": { "offset": 0, "end": 2, "count": 3, "next": null, "previous": null }, "items": [ { "id": "5d314a1cb91b4a4180b1f670", "cid": 1, "name": "Contract Administrator", "matching_id": null, "data_category": "man", "position": 1, "group": null, "section": "5d1bf672314a41180b4a1d38", "type": "dropdown" }, { "id": "5d314a1cb91bb1f674a41801", "cid": 2, "name": "Agreement Category", "matching_id": null, "data_category": "man", "position": 2, "group": null, "section": "5d1bf672314a41180b4a1d38", "type": "dropdown" } { "id": "5d314a1cb91b4a4180b428650", "cid": 3, "name": "Contract Date", "matching_id": null, "data_category": "man", "position": 1, "group": null, "section": "5d1bf672314a41180b4a1d38", "type": "date" }, ] }
Tag values are entered by using a JSON array:
[ { "cid": 1, "value": { "value": "Jessica Smith" } }, { "cid": 2, "value": { "value": "Memorandum of Understanding" } }, { "cid": 3, "value": { "value": "2022-01-04" } } ]
The following table describes the JSON array variables.
Value | Description |
---|---|
cid: integer | Tag CID |
value | The tag value. Possible values are: integer, string, array, date. |
Use the following endpoint to enter the tag values in the agreement.
curl -X 'PUT' \ 'https://company.eraclm.com/rest/v2/agreement/882/tag/values/' \ -H 'accept: */*' \ -H 'X-API-Key: c302dcd552e7c60b9d1a17765d80104308ab8d64' \ -H 'Content-Type: application/json' \ -d '[ { { "cid": 1, "value": { "value": "Jessica Smith" } }, { "cid": 2, "value": { "value": "Memorandum of Understanding" } }, { "cid": 3, "value": { "value": "2022-01-04" } } ]'
The endpoint requires the tag values entered in a JSON file:
[ { { "cid": 1, "value": { "value": "Jessica Smith" } }, { "cid": 2, "value": { "value": "Memorandum of Understanding" } }, { "cid": 3, "value": { "value": "2022-01-04" } } ]
Enter dates in the following JSON statement:
{ "cid": 3, "value": { "value": 2020-01-04" }
4 Send the agreement to negotiation
Use the following endpoint to send the agreement to negotiation.
curl -X 'PUT' \ 'https://company.eraclm.com/rest/v2/agreement/882/:rpc' \ -H 'accept: application/json' \ -H 'X-API-Key: c302dcd552e7c60b9d1a17765d80104308ab8d64' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 882, "method": "send", "params": {} }'
where id
is the agreementCID
. Note that the endpoint needs the following JSON statement.
{ "jsonrpc": "2.0", "id": 882, "method": "send", "params": {} }
After the endpoint sends the agreement to negotiation, the rest of the negotiation process must be done by using the EraCLM platform.
5 Download the final agreement
After the agreement has been accepted or signed, you can dowload the agreement as a PDF file.
curl -X 'PUT' \ 'https://company.eraclm.com/rest/v2/agreement/882/content?format=pdf' \ -H 'accept: application/json' \ -H 'X-API-Key: c302dcd552e7c60b9d1a17765d80104308ab8d64'