API

Information

This API - (Application Programming Interface) allows you to incorporate functions normally executed on the Egreement web site into your own web site or application. The list below identifies the different types of resources that you can retrieve using the API. The API also supports methods to insert, update, or delete some of these resources.

This guide explains how to use the API to perform all operations. The guide is organized by resource type. For each resource type, the guide lists one or more data representations, and resources are represented as JSON objects. The guide also lists supported methods (GET, POST, DELETE, etc.) for each resource type and explains how to use those methods in your application.

  • Production: https://api.egreement.com/v2

    Integration: https://prodtest.egreement.com/api/v2

  • Name Description

    accessKey

    Your unique API-key, which you have received from Egreement.

    Example: NasdNd34Jndf

    If you have not yet received an access key, please contact info@egreement.com

    accountId

    The ID of the person who will create the agreement. This ID is unique for each company user.

    Example: 1124

    Accept-Language

    Language in which the user error message will be displayed.

    As of now we only support English ('en') & Swedish ('sv'). If any other language (ex:French ('fr')) or no language provided then the default language will be English ('en').

    Example: 'sv', 'en'

  • 1. JSON Format

                                        	{    "code": "EGR-00000",    "message": "Request can not be processed",    "developerMessage": "Invalid Request",    "fieldErrors": [        {            "code": "EGR-00101",            "field": "firstName",            "message": "Party first name is required",            "developerMessage": "[firstName] cannot be null"        }    ]}
                                        

    2. XML Format

                                        	
                                        			<error>
                                        			  <code>EGR-00000</code>
                                        			  <message>Request can not be processed</message>
                                        			  <developerMessage>Invalid Request</developerMessage>
                                        			  <fieldErrors>
                                        			    <fieldError>
                                        			      <code>EGR-00101</code>
                                        			      <field>firstName</field>
                                        			      <message>Party first name is required</message>
                                        			    </fieldError>
                                        			  </fieldErrors>
                                        			</error>
                                        	
                                        

Create Agreement

This API allows you to create a new agreement, and in response it presents agreement information in JSON/XML format based on your input. By default the response will be in JSON format. In order to get the information in XML format, append .xml at the end of the URL.

NOTE: In case the total size of all the attachments is larger than 4MB, then agreement creation will be a two-step process - see the parameter attachments under Field Description.

  • POST /agreements

  • accessKey

    accountId

  •                                     	{    "name": "",    "type": "",    "expireIn": "",    "drawSignature": "",    "hideUnsigned": "",    "signatureMessage": "",    "additionalTBS": {        "senderInfo": "",        "description": ""    },    "notificationMessages": [        {            "type": "",            "additionalText": "",            "additionalRecipients": [                {                    "firstName": "",                    "lastName": "",                    "email": ""                }            ]        }    ],    "allowEmailSigning": "",    "reminders": [        {            "date": "",            "emails": [                ""            ],            "message": ""        }    ],    "parties": {        "companies": [            {                "orgNo": "",                "firstName": "",                "lastName": "",                "email": "",                "mobile": "",                "signMethods": [                    ""                ],                "signMetadata": [                    {                        "attachmentIndex": "",                        "signatureFields": [                            ""                        ]                    }                ],                "signingOrder": "",                "allowedPersons": [                    {                        "personNo": "",                        "firstName": "",                        "lastName": "",                        "email": ""                    }                ]            }        ],        "privates": [            {                "personNo": "",                "firstName": "",                "lastName": "",                "mobile": "",                "signMethods": [                    ""                ],                "email": "",                "signMetadata": [                    {                        "attachmentIndex": "",                        "signatureFields": [                            ""                        ]                    }                ],                "signingOrder": ""            }        ]    },    "text": "",    "dynamicPdf": {        "templateId": "",        "fields": [            {                "name": "",                "value": ""            }        ]    },    "attachments": [        {            "name": "",            "data": "",            "token": ""        }    ],    "webhook": {        "events": [],        "url": ""    }}
                                        
  • To create sample "FREE_TEXT" agreement

                                        	{    "name": "Sample FREE_TEXT Agreement",    "type": "FREE_TEXT",    "additionalTBS": {        "senderInfo": "Egreement AB",        "description": "Leasing av personbil ABC1233000 kr/månad"    },    "parties": {        "privates": [            {                "personNo": "19781013XXXX",                "firstName": "Anna",                "lastName": "Andersson",                "email": "anna.andersson@egreement.com",                "signMetadata": [                    {                        "attachmentIndex": "0",                        "signatureFields": [                            "input1",                            "input4",                            "input5"                        ]                    },                    {                        "attachmentIndex": "1",                        "signatureFields": [                            "input2",                            "input3",                            "input6"                        ]                    }                ],                "signingOrder": "1"            }        ],        "companies": [            {                "orgNo": "555555XXXX",                "firstName": "Anna",                "lastName": "Andersson",                "email": "anna.andersson@egreement.com",                "signMetadata": [                    {                        "attachmentIndex": "0",                        "signatureFields": [                            "input6",                            "input2",                            "input3"                        ]                    },                    {                        "attachmentIndex": "1",                        "signatureFields": [                            "input1",                            "input4",                            "input5"                        ]                    }                ],                "signingOrder": "2",                "allowedPersons": [                    {                        "personNo": "19781013XXXX",                        "firstName": "Anna",                        "lastName": "Andersson",                        "email": "anna.andersson@egreement.com"                    }                ]            }        ]    },    "text": "Sample Text",    "attachments": [        {            "token": "7f0de170fc2c41d6b9d1fedee61c47db"        },        {            "token": "87kgkgde170fc2c41d6b9d1fedeej59a"        }    ]}
                                        

    To create sample "FREE_TEXT" agreement - with attachments (File Upload)

                                        	{    "name": "Sample FREE_TEXT Agreement - with attachments (File Upload)",    "type": "FREE_TEXT",    "parties": {        "privates": [            {                "mobile": "+46XXXXXXXXXX",                "signMethods": [                    "SMS_OTP"                ],                "firstName": "Anna",                "lastName": "Andersson",                "email": "anna.andersson@egreement.com",                "signingOrder": "1"            }        ],        "companies": [            {                "orgNo": "555555XXXX",                "firstName": "Anna",                "lastName": "Andersson",                "email": "anna.andersson@egreement.com",                "signingOrder": "2",                "allowedPersons": [                    {                        "personNo": "19781013XXXX",                        "firstName": "Anna",                        "lastName": "Andersson",                        "email": "anna.andersson@egreement.com"                    }                ]            }        ]    },    "text": "Sample Text",    "attachments": [        {            "token": "7f0de170fc2c41d6b9d1fedee61c47db"        }    ]}
                                        

    To create sample "FREE_TEXT" agreement - with attachments (BASE64 string)

                                        	{    "name": "Sample FREE_TEXT Agreement - with attachments",    "type": "FREE_TEXT",    "parties": {        "privates": [            {                "personNo": "19781013XXXX",                "firstName": "Anna",                "lastName": "Andersson",                "email": "anna.andersson@egreement.com",                "signingOrder": "1"            }        ],        "companies": [            {                "orgNo": "555555XXXX",                "firstName": "Anna",                "lastName": "Andersson",                "email": "anna.andersson@egreement.com",                "signingOrder": "2",                "allowedPersons": [                    {                        "personNo": "19781013XXXX",                        "firstName": "Anna",                        "lastName": "Andersson",                        "email": "anna.andersson@egreement.com"                    }                ]            }        ]    },    "text": "Sample Text",    "attachments": [        {            "name": "sample-file.txt",            "data": ""        }    ]}
                                        
  • Name Description

    name

    name of the agreement.

    type

    type of the agreement.

    Choose from options below:

    FREE_TEXT: The content of the agreement shall also be sent in the request. See text field.

    ATTACHED: Attach at least one valid attachment. See attachments field.

    DYNAMIC_PDF: Pass values that will populate the fields of a PDF template that previously has been uploaded on www.egreement.com. See dynamicPdf field.

    expireIn

    (Optional) In number of day(s), the agreement will automatically be rejected by the system (if the agreement still hasn't been signed by all the parties).

    If no value is specified, the agreement will be automatically rejected after 60 days. Maximum : 99, Minimum : 0

    drawSignature

    (Optional) Possible value: true|false.

    If set to true, the agreement can be signed using draw signature method(A handwritten signature drawn on a digital canvas).

    hideUnsigned

    (Optional) Possible value: true|false.

    If set to true, the agreement will not get listed on party's agreement list page.

    signatureMessage

    (Optional) Customized message (PLAIN TEXT) which will be displayed in the Draw Signature Panel.

    Only applicable when drawSignature is true

    Maximum limit is 120 characters

    additionalTBS

    (Optional) Additional Information to be included in the To Be Signed text (TBS). TBS is a text that is used to sign the agreement using EID.

    additionalTBS.senderInfo

    (Optional) Name of the Sender that should be included in TBS.

    additionalTBS.description

    (Optional) Description that should be included in TBS.

    notificationMessages

    (Optional) Specify what notifications should be sent. For details see fields below.

    If the field is not specified, default notifications will be sent.

    If the field is specified and value is null or empty array, no notification will be sent.

    If the field and the value both are specified, only specified notifications including the additional text (if specified) will be sent.

    notificationMessages.type

    type of the notification to send.

    Choose from the options below:

    posted: notifies the parties, that an agreement is awaiting their signature. A notification includes a link to the agreement.

    rejected: notifies the parties, that an agreement has been rejected.

    autoRejectionReminder: notifies the parties, that an agreement is about to be automatically rejected (i.e. expireIn has expired).

    autoRejection: notifies the parties, that an agreement has been automatically rejected.

    signed: notifies the parties, that an agreement has been signed.

    closed: notifies the parties, that an agreement has been closed (i.e. signed by all parties). A PDF version of the agreement is attached to this notification.

    notificationMessages.additionalText

    (Optional) Additional text to be included in the notification message.

    Maximum 30,000 characters allowed.

    notificationMessages.additionalRecipients

    (Optional) Information about the additional recipients who should receive the notification.

    notificationMessages.additionalRecipients.firstName

    (Optional) First name of the additional recipient

    notificationMessages.additionalRecipients.lastName

    (Optional) Last name of the additional recipient

    notificationMessages.additionalRecipients.email

    Email address of the additional recipient

    Must be a valid email address. Notifications will be sent to this email address for the configured events.

    allowEmailSigning

    (Optional) Possible value: true|false.

    If set to true, then the user will be able to sign the agreement via a link in the email. Otherwise the user will be redirected to the home page.

    reminders

    (Optional) Allows the agreement creator to add a message in the email notification sent to parties on a specific date.

    reminders.date

    date, when to send reminder.

    • format: yyyy-MM-dd
    • timezone: CET
    • should be equal or greater than today

    reminders.emails

    comma(,) separates email addresses to send reminder to.

    reminders.message

    Message for the reminder, which will be sent as an email.

    Maximum 30,000 characters allowed.

    When sending plain text, the message will be sent without formatting.

    HTML is also allowed to format the content, only inline CSS are allowed and scripts will be treated as plain text.

    parties

    parties of the agreement.

    For private parties - see "privates".

    For company parties - see "companies".

    parties.privates

    Adding private party (all fields below can be repeated for multiple parties).

    If a party is an individual, it will be added as a PRIVATE PARTY.

    parties.privates.firstName

    First name of the private party.

    parties.privates.lastName

    Last name of the private party.

    parties.privates.email

    Email address of the private party.

    Must be a valid email address. Notifications will be sent to this email address on agreement related events.

    parties.privates.mobile

    Valid mobile number with country code.

    Supported format: +CC XXXXXXXXXX

    Required if parties.privates.signMethods is SMS_OTP

    parties.privates.personNo

    Personal identification number of the party.

    Supported formats:

    1. YYYYMMDDXXXX
    2. YYYYMMDD-XXXX
    3. YYMMDDXXXX
    4. YYMMDD-XXXX

    parties.privates.signMethods

    The associated party will be restricted to sign the agreement only through the configured methods

    Default value will be set to EID if signMethods is not provided.

    signMethods, can contain only one option.

    Ex "signMethods" : [ "SMS_OTP" ]

    signMethods, can only be set to the methods in the following list (EID, SMS_OTP,EMAIL_OTP,EMAIL).

    parties.privates.signingOrder

    (Optional) Order in which posted/created email notifications will be sent. Order should start from 1. If the value is not provided, it will be 1.

    Example: an agreement with 3 parties X, Y, Z having the order 1, 2, 3 respectively. When the agreement gets created the email notification will only be sent to the party X (having order 1). When party X signs the agreement, the posted email notification will be sent to party Y (having order 2) and the flow continues until the last party signs the agreement.

    parties.privates.signMetadata

    (Optional) It enables the user to specify the fields of the attachment where the draw signature of the party (A handwritten signature drawn on a digital canvas) should be injected.

    parties.privates.signMetadata.attachmentIndex

    An unique identifier assigned incrementally or sequentially to the attachment by the way the attachments node of the JSON request is formed.

    It should start from 0

    Ex : If specified 0, which means it refers to attachments[0]. (i,e., First item of the attachment section)

    parties.privates.signMetadata.signatureFields

    Fields of attached pdf where the parties signature (draw signature) should be injected.

    Multiple fields can be specified.

    Only applicable when drawSignature is true

    Note : If the Fields defined here are not present in the attached editable pdf it will result in errors when the party signs the agreement

    parties.companies

    Adding company party (all fields below can be repeated for multiple parties). If a party is an organization which authorizes one or more individuals to manage the agreement on behalf of that organization, it should be added as COMPANY PARTY.

    parties.companies.firstName

    First name of the company's reference person (the person who should be contacted if questions arise regarding the agreement).

    parties.companies.lastName

    Last name of the company's reference person.

    parties.companies.email

    Email address of the company or of the person responsible for the agreement.

    Must be a valid email address. Notifications will be sent to this address on the occurrence of agreement-related events.

    parties.companies.orgNo

    Unique identification number of the organization.

    Supported formats:

    1. XXXXXXXXXX
    2. XXXXXX-XXXX

    parties.companies.mobile

    Valid mobile number with country code.

    Supported format: +CC XXXXXXXXXX

    Required if parties.companies.signMethods is SMS_OTP

    parties.companies.signMethods

    The associated party will be restricted to sign the agreement only through the configured methods

    Default value will be set to EID if signMethods is not provided.

    signMethods, can contain only one option.

    Ex "signMethods" : [ "SMS_OTP" ]

    signMethods, can only be set to the methods in the following list (EID, SMS_OTP,EMAIL_OTP,EMAIL).

    parties.companies.signingOrder

    (Optional) Order in which posted/created email notifications will be sent. Order should start from 1. If the value is not provided, it will be 1.

    Example: an agreement with 3 parties X, Y, Z having the order 1, 2, 3 respectively. When the agreement gets created the email notification will only be sent to the party X (having order 1). When party X signs the agreement, the posted email notification will be sent to party Y (having order 2) and the flow continues until the last party signs the agreement.

    parties.companies.signMetadata

    (Optional) It enables the user to specify the fields of the attachment where the draw signature of the party (A handwritten signature drawn on a digital canvas) should be injected.

    parties.companies.signMetadata.attachmentIndex

    An unique identifier assigned incrementally or sequentially to the attachment by the way the attachments node of the JSON request is formed.

    It should start from 0

    Ex : If specified 0, which means it refers to attachments[0]. (i,e., First item of the attachment section)

    parties.companies.signMetadata.signatureFields

    Fields of attached pdf where the parties signature (draw signature) should be injected.

    Multiple fields can be specified.

    Only applicable when drawSignature is true

    Note : If the Fields defined here are not present in the attached editable pdf it will result in errors when the party signs the agreement

    parties.companies.allowedPersons

    (Optional) Restricts who can sign on behalf of the organization to the specified person(s). All fields fields below can be repeated for multiple allowed persons.

    parties.companies.allowedPersons.firstName

    First name of the person.

    parties.companies.allowedPersons.lastName

    Last name of the person.

    parties.companies.allowedPersons.email

    Email address of the person. Must be a valid email address.

    Notifications will be sent on the occurrence of agreement related events.

    parties.companies.allowedPersons.personNo

    Personal identification number of the person.

    Supported formats:

    1. YYYYMMDDXXXX
    2. YYYYMMDD-XXXX
    3. YYMMDDXXXX
    4. YYMMDD-XXXX

    text

    Used when type field is FREE_TEXT.

    Maximum 30,000 characters allowed.

    When sending plain text, the text will be rendered without formatting. But it is also possible to send HTML, which will then format the text.

    dynamicPdf

    Used when type field is DYNAMIC_PDF.

    A valid template ID must be passed.

    The agreement will be based on that template. See field section for passing the value to template fields.

    dynamicPdf.templateId

    ID of dynamic PDF for DYNAMIC_PDF type.

    dynamicPdf.fields

    This is the dynamic PDF field & value array.

    dynamicPdf.fields.name

    Name and value fields used together for passing the value to the input field in the template (see dynamicPdfId).

    dynamicPdf.fields.value

    If the value is Boolean(True/False) then that field is considered as checkBox.

    attachments

    Follow below instructions to attach files:

    1. If the total size of all the attachments is less than 4MB, convert file data in BASE64 string- and convert file content to BASE64 and assign it in to attachments.data (CreateAgreement JSON request).

    2. If the total size of all the attachments is more than 4MB, use File Upload service to upload the attachment- and use the returned token to create the agreement. On successful agreement creation, the file related to the token will be automatically deleted.

    The total size of all the attachments must be less than 12MB in any case.

    attachments.name

    Optional: name of the attached file.

    Mandatory: If attachments.data is not empty.

    attachments.data

    Optional: Content of the attached file (should be BASE64 format).

    Mandatory: If attaching file's BASE64 string.

    attachments.token

    Optional: Token of the attachment that has been uploaded using File Upload.

    Mandatory: If the total size of the attachments is more than 4MB.

    webhook

    Optional: Specify hook for events on agreement.

    webhook.events

    Events that should be notified to the configured http callback url.

    Atleast one events should be set from the below list:

    POSTED: When the agreement is posted via API

    SIGNED: When the agreement is signed by a party

    SIGNED_BY_ALL: When the agreement is signed by the last party

    REJECTED: When the agreement is rejected

    webhook.url

    An URL of the http callback service that will be notified when an event occurred on the agreement.

    The service should be designed to support following specification:

       1. Method : HTTP POST

       2. Accepts : JSON

       3. Response (within 30sec)

          a. Success : HTTP 200

          b. Failure : Other than (HTTP 200)

    For more Information: See Webhook documentation.

  • Success: HTTP 200

    closedOn - will be returned only if status is closed.

    rejectedOn - will be returned only if status is rejected.

    parties.companies.personNo - will be returned only if status is signed or rejected.

    parties.companies.signedOn - will be returned only if status is signed.

    parties.companies.rejectedOn - will be returned only if status is rejected.

    parties.privates.signedOn - will be returned only if status is signed.

    parties.privates.rejectedOn - will be returned only if status is rejected

                                        	{    "referenceNumber": "",    "name": "",    "status": "",    "postedOn": "",    "expireOn": "",    "closedOn": "",    "rejectedOn": "",    "lastModifiedOn": "",    "parties": {        "companies": [            {                "id": "",                "orgNo": "",                "name": "",                "status": "",                "personNo": "",                "signedOn": "",                "rejectedOn": ""            }        ],        "privates": [            {                "id": "",                "personNo": "",                "name": "",                "status": "",                "signedOn": "",                "rejectedOn": ""            }        ]    }}
                                        

    Example: Create sample "FREE_TEXT" agreement - Response

                                        	{    "referenceNumber": "1602000XXXXX",    "name": "Sample FREE_TEXT Agreement",    "status": "POSTED",    "postedOn": "2016-02-09 13:54:01",    "expireOn": "2016-04-09 23:59:00",    "lastModifiedOn": "2016-02-09 13:54:03",    "parties": {        "privates": [            {                "personNo": "19781013XXXX",                "name": "Anna",                "status": "NOT_SIGNED"            }        ],        "companies": [            {                "orgNo": "555555XXXX",                "name": "Andreas AB",                "status": "NOT_SIGNED"            }        ]    }}
                                        
    Failure:

    HTTP 400:

    Please check your input parameters (accessKey missing/blank OR invalid JSON).

    Input validation error messages.

    HTTP 401:

    Access denied (no company found with this accessKey OR accountId missing/blank OR no company account found with this accountId).

List Agreements

This API allows you to list agreements information in JSON/XML format based on your input. By default the response will be in JSON format. In order to get information in XML format, append .xml at end of the URL.

For filtration you will need to state parameters in the URL. It also supports pagination. See "Field Description" section

  • GET /agreements?templateId=${templateId}&status=${status}&from=${from}&to=${to}&offset=${offset}&max=${max}

  • accessKey

  • Name Description

    templateId

    (Optional) For listing agreements related to DynamicPdfTemplate.

    DynamicPdfTemplate allows agreement creation by filling in editable PDF.

    status

    (Optional) status of the agreement to get list.

    Possible values:

    NOT_SIGNED: Fetch the agreements that are not closed, rejected (POSTED), and sort the result based on postedOn field.

    CLOSED: Fetch the agreements that are signed by all parties (SIGNED_BY_ALL), and sort the result based on closedOn field.

    REJECTED: Fetch the agreements that are rejected by any party (REJECTED), and sort the result based on rejectedOn field.

    MODIFIED: Fetch all the agreements (POSTED, REJECTED, SIGNED_BY_ALL), and sort the result based on lastModifiedOn field.

    ALL: Fetch all the agreements (POSTED, REJECTED, SIGNED_BY_ALL), and sort the result based on postedOn field.

    from

    (Optional) It is a date. It will change its behaviour based on the "status" field.

    If status="NOT_SIGNED", date would be considered for postedOn date.

    If status="CLOSED", date would be considered for closedOn date.

    If status="REJECTED", date would be considered for rejectedOn date.

    If status="MODIFIED", date would be considered for lastModifiedOn date.

    If status="ALL", date would be considered for postedOn date.

    format: yyyy-MM-dd OR yyyy-MM-dd HH:mm:ss

    timezone: CET

    NOTE: In case of "yyyy-MM-dd" format, time "00:00:00" will be considered.

    to

    (Optional) It is a date. It will change its behaviour based on the "status" field.

    If status="NOT_SIGNED", date would be considered for postedOn date.

    If status="CLOSED", date would be considered for closedOn date.

    If status="REJECTED", date would be considered for rejectedOn date.

    If status="MODIFIED", date would be considered for lastModifiedOn date.

    If status="ALL", date would be considered for postedOn date.

    format: yyyy-MM-dd OR yyyy-MM-dd HH:mm:ss

    timezone: CET

    NOTE:

    In case of "yyyy-MM-dd" format, time "23:59:59" will be considered.

    In case only "from" field is specified, current date-time will be considered for "to" field.

    offset

    (Optional) Will fetch the agreements beginning from the given offset value.

    If the offset value is 5, then we fetch the max number of agreements from index 5.

    Default value is 0.

    max

    (Optional) Will fetch the maximum number of agreements specified.

    Default value is 100.

    Maximum value can not be set to more than 100.

  • Success: HTTP 200

    closedOn - will be returned only if status is closed.

    rejectedOn - will be returned only if status is rejected.

    parties.companies.personNo - will be returned only if status is signed or rejected.

    parties.companies.signedOn - will be returned only if status is signed.

    parties.companies.rejectedOn - will be returned only if status is rejected.

    parties.privates.signedOn - will be returned only if status is signed.

    parties.privates.rejectedOn - will be returned only if status is rejected.

                                        	{    "agreements": [        {            "referenceNumber": "",            "name": "",            "status": "",            "postedOn": "",            "expireOn": "",            "closedOn": "",            "rejectedOn": "",            "lastModifiedOn": "",            "parties": {                "companies": [                    {                        "orgNo": "",                        "name": "",                        "status": "",                        "personNo": "",                        "signedOn": "",                        "rejectedOn": ""                    }                ],                "privates": [                    {                        "personNo": "",                        "name": "",                        "status": "",                        "signedOn": "",                        "rejectedOn": ""                    }                ]            }        }    ],    "start": 0,    "count": 1,    "totalCount": 1}
                                        

    Example: Sample list agreements - Response

                                        	{    "agreements": [        {            "referenceNumber": "1602000XXXXX",            "name": "Sample FREE_TEXT Agreement",            "status": "POSTED",            "postedOn": "2016-02-09 13:54:01",            "expireOn": "2016-04-09 23:59:00",            "lastModifiedOn": "2016-02-09 13:54:03",            "parties": {                "privates": [                    {                        "personNo": "19781013XXXX",                        "name": "Anna",                        "status": "NOT_SIGNED"                    }                ],                "companies": [                    {                        "orgNo": "555555XXXX",                        "name": "Andreas AB",                        "status": "NOT_SIGNED"                    }                ]            }        }    ],    "start": 0,    "count": 1,    "totalCount": 1}
                                        
    Failure:

    HTTP 400:

    Please check your input parameters (accessKey missing/blank).

    Input validation error messages.

    HTTP 401: Access denied (no company found with this accessKey).

    HTTP 404: No record found for this criteria. (no agreements found).

Get Agreement

This API allows you to get agreement information in JSON/XML format based on your input. By default the response will be in JSON format. In order to get information in XML format, append .xml at end of the URL.

  • GET /agreements/${referenceNumber}

  • accessKey

  • Name Description

    referenceNumber

    referenceNumber of the agreement.

  • Success: HTTP 200

    closedOn - will be returned only if status is closed.

    rejectedOn - will be returned only if status is rejected.

    parties.companies.personNo - will be returned only if status is signed or rejected.

    parties.companies.signedOn - will be returned only if status is signed.

    parties.companies.rejectedOn - will be returned only if status is rejected.

    parties.privates.signedOn - will be returned only if status is signed.

    parties.privates.rejectedOn - will be returned only if status is rejected.

                                        	{    "referenceNumber": "",    "name": "",    "status": "",    "postedOn": "",    "expireOn": "",    "closedOn": "",    "rejectedOn": "",    "lastModifiedOn": "",    "parties": {        "companies": [            {                "orgNo": "",                "name": "",                "status": "",                "personNo": "",                "signedOn": "",                "rejectedOn": ""            }        ],        "privates": [            {                "personNo": "",                "name": "",                "status": "",                "signedOn": "",                "rejectedOn": ""            }        ]    }}
                                        

    Example: Sample "FREE_TEXT" agreement - Response

                                        	{    "referenceNumber": "1602000XXXXX",    "name": "Sample FREE_TEXT Agreement",    "status": "POSTED",    "postedOn": "2016-02-09 13:54:01",    "expireOn": "2016-04-09 23:59:00",    "lastModifiedOn": "2016-02-09 13:54:03",    "parties": {        "privates": [            {                "personNo": "19781013XXXX",                "name": "Anna",                "status": "NOT_SIGNED"            }        ],        "companies": [            {                "orgNo": "555555XXXX",                "name": "Andreas AB",                "status": "NOT_SIGNED"            }        ]    }}
                                        
    Failure:

    HTTP 400: Please check your input parameters (accessKey missing/blank).

    HTTP 401: Access denied (no company found with this accessKey).

    HTTP 403: Problem regarding your account, contact customer support (unauthorized company).

    HTTP 404: There is no agreement with the specified id (no agreement found with this referenceNumber).

Download Agreement

This API allows you to download the agreement in pdf format.

  • GET /agreements/${referenceNumber}/download

  • accessKey

  • Name Description

    referenceNumber

    referenceNumber of the agreement.

  • Success: HTTP 200

    A pdf file containing all signed agreement parts, documentation and logs producing a self-contained, tamper proof document.

    Failure:

    HTTP 400: Please check your input parameters (accessKey missing/blank).

    HTTP 401: Access denied (no company found with this accessKey).

    HTTP 403: Problem regarding your account, contact customer support (unauthorized company).

    HTTP 404: There is no agreement with the specified id (no agreement found with this referenceNumber).

List Agreement Field Values (DYNAMIC_PDF Type)

This API allows you to get field's value of the dynamic PDF agreement in JSON/XML format based on your input. By default the response will be in JSON format. In order to get information in XML format, append .xml at end of the URL.

  • GET /agreements/${referenceNumber}/fields

  • accessKey

  • Name Description

    referenceNumber

    referenceNumber of the agreement.

  • Success: HTTP 200
                                        	{    "referenceNumber": "",    "dynamicPdfId": "",    "fields": [        {            "type": "",            "value": ""        }    ]}
                                        

    Example: Sample "DYNAMIC_PDF" agreement field values list - Response

                                        	{    "referenceNumber": "14020000XXXX",    "dynamicPdfId": 36,    "fields": [        {            "name": "Hyra",            "value": "3400 "        },        {            "name": "Organisationsnummer",            "value": "Halmstads Fastighetsaktiebolag"        },        {            "name": "Hyresgäst",            "value": ""        },        {            "name": "Rum nr",            "value": "567"        },        {            "name": "Totalkostnad",            "value": "56700"        },        {            "name": "Bilaga",            "value": "asdfasdf"        },        {            "name": "no of furnitures",            "value": "4"        },        {            "name": "security date",            "value": "2014-03-10"        },        {            "name": "no of rullager",            "value": "6"        },        {            "name": "no of internet lines",            "value": "5"        },        {            "name": "Fastighetsskatt",            "value": "12 300"        },        {            "name": "no of phone lines",            "value": "5"        },        {            "name": "Särskilda bestämmelser",            "value": "1234567890ABCDEFGHIJ 1234567890ABCDEFGHIJ"        },        {            "name": "Från och med den",            "value": "2014-12-12"        },        {            "name": "no of phones",            "value": "6"        }    ]}
                                        
    Failure:

    HTTP 400:

     Please check your input parameters (accessKey missing/blank).

     The specified agreement is not of pdf type.

    HTTP 401: Access denied (no company found with this accessKey).

    HTTP 403: Problem regarding your account, contact customer support (unauthorized company).

    HTTP 404: There is no agreement with the specified id (no agreement found with this referenceNumber).

Reject Agreement

This API allows you to reject the agreement and serves rejection information in JSON/XML format based on your input. By default the response will be in JSON format. In order to get information in XML format, append .xml at end of the URL.

  • POST /agreements/${referenceNumber}/reject

  • accessKey

  • Name Description

    referenceNumber

    referenceNumber of the agreement.

    partyType

    Possible values:

    PRIVATE: to reject an agreement from a private party.

    COMPANY: to reject an agreement from a company party.

    personNo

    Personal identification number of the person who is rejecting the agreement. This person number can be one of the person number from the private parties or from the allowed/authorized person of company parties.

    Required.

    1. YYYYMMDDXXXX

    2. YYYYMMDD-XXXX

    3. YYMMDDXXXX

    4. YYMMDD-XXXX

    orgNo

    Unique identification number of the organization which is one of the party of agreement being rejected.

    Required, when partyType is COMPANY.

    XXXXXXXXXX

    XXXXXX-XXXX

  •                                     	{    "partyType": "",    "personNo": "",    "orgNo": ""}
                                        
  • Example: To reject an agreement with reference number 1601000XXXXX and private party having person number 19770407XXXX.

                                        	{    "partyType": "PRIVATE",    "personNo": "19770407XXXX"}
                                        

    Example: To reject an agreement with reference number 1601000XXXXX and company party having allowed/authorized person number 19770407XXXX and organisation number 555555XXXX.

                                        	{    "partyType": "COMPANY",    "personNo": "19770407XXXX",    "orgNo": "555555XXXX"}
                                        
  • Success: HTTP 200

    orgNo - will be returned only if partyType is COMPANY.

                                        	{    "referenceNumber": "1606000XXXXX",    "rejectedBy": {        "orgNo": "555555XXXX",        "personNo": "19770407XXXX"    }}
                                        
    Failure:

    HTTP 400:

     Please check your input parameters (accessKey missing/blank).

     Input validation failure messages.

    HTTP 401: Access denied (no company found with this accessKey).

    HTTP 403: Problem regarding your account, contact customer support (no account found for party OR unauthorized party OR already rejected).

    HTTP 404: There is no agreement with the specified id (no agreement found with this referenceNumber).

Revoke Agreement

This API allows agreement Owner to revoke the agreement and serves revocation information in JSON/XML format based on your input. By default the response will be in JSON format. In order to get information in XML format, append .xml at end of the URL.

Prerequisites: You can only revoke an agreement, if

The agreement is not rejected / signed by all / (already) revoked

You are the owner of the agreement

  • PUT /agreements/${referenceNumber}/revoke

  • accessKey

    accountId

  • Name Description

    referenceNumber

    referenceNumber of the agreement.

  • Success: HTTP 200

    revokedOn - date of revocation.

    parties.companies.personNo - will be returned only if status is signed or rejected.

    parties.companies.signedOn - will be returned only if status is signed.

    parties.companies.rejectedOn - will be returned only if status is rejected.

    parties.privates.signedOn - will be returned only if status is signed.

    parties.privates.rejectedOn - will be returned only if status is rejected.

                                        	{    "referenceNumber": "",    "name": "",    "status": "",    "postedOn": "",    "expireOn": "",    "revokedOn": "",    "lastModifiedOn": "",    "parties": {        "companies": [            {                "orgNo": "",                "name": "",                "status": "",                "personNo": "",                "signedOn": "",                "rejectedOn": ""            }        ],        "privates": [            {                "personNo": "",                "name": "",                "status": "",                "signedOn": "",                "rejectedOn": ""            }        ]    }}
                                        

    Example: Sample "FREE_TEXT" agreement - Response

                                        	{    "referenceNumber": "1602000XXXXX",    "name": "Sample FREE_TEXT Agreement",    "status": "REVOKED",    "postedOn": "2016-02-09 13:54:01",    "expireOn": "2016-04-09 23:59:00",    "revokedOn": "2016-04-09 23:59:00",    "lastModifiedOn": "2016-02-09 23:59:00",    "parties": {        "privates": [            {                "personNo": "19781013XXXX",                "name": "Anna",                "status": "NOT_SIGNED"            }        ],        "companies": [            {                "orgNo": "555555XXXX",                "name": "Andreas AB",                "status": "NOT_SIGNED"            }        ]    }}
                                        
    Failure:

    HTTP 400: Please check your input parameters (accessKey missing/blank).

    HTTP 401: Access denied (no company found with this accessKey).

    HTTP 403: Problem regarding your account, contact customer support (unauthorized company).

    HTTP 404: There is no agreement with the specified id (no agreement found with this referenceNumber).

Delete Agreement

This API allows you to delete an existing agreement and in response it presents the status of the action in text format.

Prerequisites: You can only delete an agreement, if

  1. The agreeent has been rejected

  2. The agreement was created by you OR you are one of the parties

  • DELETE /agreements/${referenceNumber}

  • accessKey

    accountId

  • Name Description

    referenceNumber

    referenceNumber of the agreement.

  • Success: HTTP 200

    Agreement with reference number XXXXXXXXXX deleted successfully

    Failure:

    HTTP 400:

     Please check your input parameters (accessKey missing/blank).

     Input validation failure messages.

    HTTP 401: Access denied (no company found with this accessKey).

    HTTP 403: Problem regarding your account, contact customer support (no account found for party OR unauthorized party OR already deleted).

    HTTP 404: There is no agreement with the specified id (no agreement found with this referenceNumber).

Sign Agreement

This API allows to make a simplified sign of the agreement for company parties and serves signing information in JSON/XML format based on your input. The signature does not require any eid or any other identification than the API key. By default the response will be in JSON format. In order to get information in XML format, append .xml at end of the URL.

Prerequisites: You can only sign the agreement, if

  1. The agreeent has not been closed (rejected or signed by all)

  2. You are a company party of the agreement

  • POST /agreements/${referenceNumber}/sign

  • accessKey

  • Name Description

    partyType

    Type of party (Only COMPANY is allowed).

    orgNo

    Unique identification number of the organization whom agreement is getting signed on behalf.

    Supported formats:

    XXXXXXXXXX

    XXXXXX-XXXX

    personNo

    Personal identification number of the person who is signing the agreement on behalf of organization.

    Supported formats:

    1. YYYYMMDDXXXX

    2. YYYYMMDD-XXXX

    3. YYMMDDXXXX

    4. YYMMDD-XXXX

    firstName

    First name of the person.

    lastName

    Last name of the person.

    signedOn

    (optional) Time at which the agreement was actually signed.

    Default current time will be set if not provided.

    Format : The number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this date

    eg. 'Fri Sep 23 09:50:28 CEST 2016' is represented as '1474617028037'.

  •                                     	{    "partyType": "",    "orgNo": "",    "personNo": "",    "firstName": "",    "lastName": "",    "signedOn": ""}
                                        
  • Example: To sign an agreement (1601000XXXXX) with company party

                                        	{    "partyType": "COMPANY",    "orgNo": "556700XXXX",    "personNo": "19870106XXXX",    "signedOn": "1474614366929"}
                                        
  • Success: HTTP 200
                                        	{    "referenceNumber": "1601000XXXXX",    "signedBy": {        "orgNo": "",        "personNo": ""    }}
                                        
    Failure:

    HTTP 400:

    Please check your input parameters (accessKey missing/blank).

    Input validation error messages.

    HTTP 401: Access denied (no company found with this accessKey OR accountId missing/blank OR no company account found with this accountId).

    HTTP 403: Problem regarding your account, contact customer support (unauthorized company).

    HTTP 404: There is no agreement with the specified id (no agreement found with this referenceNumber).

Share Agreement

This API allows you to share the agreement with specified person/company and serves sharing information in JSON/XML format based on your input. By default the response will be in JSON format. In order to get information in XML format, append .xml at end of the URL.

  • POST /agreements/${referenceNumber}/share

  • accessKey

    accountId

  • Name Description

    referenceNumber

    referenceNumber of the agreement.

    shareWithType

    Possible value:

    PERSON: to share with a private account.

    ORGANIZATION: to share with a company.

    personNo

    Personal identification number of the person with whom the agreement is shared.

    Required, when shareWithType is PERSON.

    1. YYYYMMDDXXXX

    2. YYYYMMDD-XXXX

    3. YYMMDDXXXX

    4. YYMMDD-XXXX

    orgNo

    Unique identification number of the organization with whom the agreement is shared.

    Required, when shareWithType is ORGANIZATION.

    XXXXXXXXXX

    XXXXXX-XXXX

    email

    Valid email address to which the email notification will be sent.

    message

    Message to send by email notification.

    Maximum 30,000 characters allowed.

    When sending plain text, the message will be sent without formatting.

    HTML is also allowed to format the content, only inline CSS are allowed and scripts will be treated as plain text.

    shareType

    Possible values:

    PERMANENT

    TILL_DATE: in this case you must pass the value to the "date" field.

    date

    Date when the share will be automatically revoked. Mandatory only if shareType is "TILL_DATE".

    format: yyyy-MM-dd

    timezone: CET

    should be equal or later than today

  •                                     	{    "shareWithType": "",    "personNo": "",    "orgNo": "",    "email": "",    "message": "",    "shareType": "",    "date": ""}
                                        
  • Example: To share an agreement (1601000XXXXX) with private person permanently

                                        	{    "shareWithType": "PERSON",    "personNo": "19770407XXXX",    "email": "anna.andersson@egreement.com",    "message": "Hi I am being shared",    "shareType": "PERMANENT"}
                                        

    Example: To share an agreement (1601000XXXXX) with company permanently

                                        	{    "shareWithType": "ORGANIZATION",    "orgNo": "555555XXXX",    "email": "anna.andersson@egreement.com",    "message": "Hi I am being shared",    "shareType": "PERMANENT"}
                                        

    Example: To share an agreement (1601000XXXXX) with private person until certain date

                                        	{    "shareWithType": "PERSON",    "personNo": "19770407XXXX",    "email": "anna.andersson@egreement.com",    "message": "Hi I am being shared",    "shareType": "TILL_DATE",    "date": "2016-02-15"}
                                        
  • Success: HTTP 200

    sharedWith - will have personal identification number if shared with private person, or organization number if shared with company.

                                        	{    "referenceNumber": "",    "sharedWith": "",    "shareType": ""}
                                        

    Example: Share an agreement (1601000XXXXX) with private person permanently - Response

                                        	{    "referenceNumber": "1601000XXXXX",    "sharedWith": "19770407XXXX",    "shareType": "permanent"}
                                        

    Example: Share an agreement (1601000XXXXX) with company permanently - Response

                                        	{    "referenceNumber": "1601000XXXXX",    "sharedWith": "555555XXXX",    "shareType": "permanent"}
                                        

    Example: Share an agreement (1601000XXXXX) with private person permanently - Response

                                        	{    "referenceNumber": "1601000XXXXX",    "sharedWith": "19770407XXXX",    "shareType": "till 2016-02-15"}
                                        
    Failure:

    HTTP 400:

    Please check your input parameters (accessKey missing/blank).

    Input validation error messages.

    HTTP 401: Access denied (no company found with this accessKey OR accountId missing/blank OR no company account found with this accountId).

    HTTP 403: Problem regarding your account, contact customer support (unauthorized company).

    HTTP 404: There is no agreement with the specified id (no agreement found with this referenceNumber).

File Upload (for Agreement Attachment)

This API allows you to upload a file for an agreement attachment and will present upload information in JSON/XML format based on your input. By default the response will be in JSON format. In order to get information in XML format, append .xml at end of the URL.

  • POST /files/attachment/agreement

  • accessKey

  • Sample CURL request to upload file

                                            curl -XPOST-H 'accessKey: your key'-F 'file=@C:\Users\Name\Downloads\Activity log req spec.pdf'
                                        
  • Success: HTTP 200
                                        	{    "token": "",    "fileName": "",    "createdOn": ""}
                                        

    Example: New file uploaded - Response

                                        	{    "token": "eb01ceaf11054f019825b3cb84506557",    "fileName": "Activity log req spec.pdf",    "createdOn": "2016-02-10 08:19:09"}
                                        
    Failure:

    HTTP 400: Please check your input parameters (accessKey missing/blank).

    HTTP 401: Access denied (no company found with this accessKey).

List Files Uploaded (for Agreement Attachment)

This API allows you to list the information of a file uploaded for agreement attachment in JSON/XML format based on your input. By default the response will be in JSON format. In order to get information in XML format, append .xml at end of the URL.

  • GET /files/attachment/agreement

  • accessKey

  • Success: HTTP 200
                                        	{    "items": [        {            "token": "",            "fileName": "",            "createdOn": ""        }    ],    "start": 0,    "count": 1,    "totalCount": 1}
                                        

    Example: List files uploaded - Response

                                        	{    "items": [        {            "token": "5dc067cbfca54e7dbd5f45b570284f12",            "fileName": "This is for testing.pdf",            "createdOn": "2016-02-09 08:31:05"        },        {            "token": "eb01ceaf11054f019825b3cb84506557",            "fileName": "Activity log req spec.pdf",            "createdOn": "2016-02-10 08:19:09"        }    ],    "start": 0,    "count": 2,    "totalCount": 2}
                                        
    Failure:

    HTTP 400: Please check your input parameters (accessKey missing/blank).

    HTTP 401: Access denied (no company found with this accessKey).

    HTTP 404: No record found for this criteria. (no files found).

Get File Uploaded (for Agreement Attachment)

This API allows you to get the information of a file uploaded as agreement attachment in JSON/XML format based on your input. By default the response will be in JSON format. In order to get information in XML format, append .xml at end of the URL.

  • GET /files/attachment/agreement/${token}

  • accessKey

  • Name Description

    token

    token of the file uploaded.

  • Success: HTTP 200
                                        	{    "token": "",    "fileName": "",    "createdOn": ""}
                                        

    Example: Get file uploaded with token (eb01ceaf11054f019825b3cb84506557) - Response

                                        	{    "token": "eb01ceaf11054f019825b3cb84506557",    "fileName": "Activity log req spec.pdf",    "createdOn": "2016-02-10 08:19:09"}
                                        
    Failure:

    HTTP 400: Please check your input parameters (accessKey missing/blank).

    HTTP 401: Access denied (no company found with this accessKey).

    HTTP 403: Problem regarding your account, contact customer support (unauthorized company).

    HTTP 404: There is no item with the specified token (no file found with token).

    HTTP 500: Please check your input parameters (file has been already used and deleted, or file has been deleted by timeout).

Delete File Uploaded (for Agreement Attachment)

This API allows you to delete the a file uploaded as agreement attachment and serves information after deletion in JSON/XML format based on your input. By default the response will be in JSON format. In order to get information in XML format, append .xml at end of the URL.

  • DELETE /files/attachment/agreement/${token}

  • accessKey

  • Name Description

    token

    token of the file uploaded.

  • Success: HTTP 200
                                        	{    "token": "",    "fileName": "",    "deletedOn": ""}
                                        

    Example: Delete file uploaded with token (eb01ceaf11054f019825b3cb84506557) - Response

                                        	{    "token": "eb01ceaf11054f019825b3cb84506557",    "fileName": "Activity log req spec.pdf",    "deletedOn": "2016-02-10 08:24:17"}
                                        
    Failure:

    HTTP 400: Please check your input parameters (accessKey missing/blank).

    HTTP 401: Access denied (no company found with this accessKey).

    HTTP 403: Problem regarding your account, contact customer support (unauthorized company).

    HTTP 404: There is no item with the specified token (no file found with token).

    HTTP 500: Please check your input parameters (file has been already used and deleted, or file has been deleted by timeout).

Return to Top