Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

You can send Files directly to TLDCRM and attach them to any Lead or Policy in the system. This is useful for third party systems that are being used to collect document data and need to store and attach it to a record in TLD securely.

Endpoints: /api/ingress/documents/upload/lead,/api/ingress/documents/policy

Method: POST

API Version Support: v1

Security Notice: Please make sure to use

when giving this access to third party systems as API Keys are unprotected unless specified.

The proper endpoint protection to set for an API using this Endpoint is /api/ingress/documents/upload* Make sure to include the *

Data Formats Supported

multipart/form-data, Form Parameters. JSON Form Body is not Supported at the moment.

Response Codes

200: Success and Warnings

400: Error

Upload: Add a Document to a Lead

Endpoint: /api/ingress/documents/upload/lead

Parameter

Required

Format

Description

lead_id

integer

A Valid Lead ID.

file

A “File” type multipart/form-data file

TLD Will only accept one file per call. The first file found in the form-data will be used as well as it’s name. The form-data key does not need to be file as long as it is sent as a file type in can be of any non-conflicting form key.

description

string

A text description of the file.

type_id

integer

A Document Type ID. You can find these by going to Settings -> Fields in TLDCRM and using the middle dropdown menu to find Document Types. You can append /fields?field=document_type&limit=100&page=1&order_by=id&sort=ASCto your TLDCRM Domain to get there quickly. Default Value is 9 "API". You can both customize file type names and descriptions as well as add your own in the Fields section.

status

integer, 0, 1, 2

Default 1. Valid Options are -1 - Flagged, 0 - Trashed, 1 - Private, 2 - Public. Public documents can be accessed via their short URL or the Direct CRM URL. Otherwise documents can only be seen by logged in users with permissions to see documents.

Return Parameters

JSON Success Object

{
    "result": "Document Added",
    "code": 1,
    "document_id": "3107"
}

JSON Error Object

{
    "error": "No document provided.",
    "code": -1
}

Upload: Add a Document to a Policy

Endpoint: /api/ingress/documents/upload/policy

Parameter

Required

Format

Description

policy_id

integer

A Valid Policy ID.

file

A “File” type multipart/form-data file

TLD Will only accept one file per call. The first file found in the form-data will be used as well as it’s name. The form-data key does not need to be file as long as it is sent as a file type in can be of any non-conflicting form key.

description

string

A text description of the file.

type_id

integer

A Document Type ID. You can find these by going to Settings -> Fields in TLDCRM and using the middle dropdown menu to find Document Types. Default is 9 "Ingress Document". You can both customize file type names and descriptions as well as add your own in the Fields section.

status

integer, 0, 1, 2

Default 1. Valid Options are -1 - Flagged, 0 - Trashed, 1 - Private, 2 - Public. Public documents can be accessed via their short URL or the Direct CRM URL. Otherwise documents can only be seen by logged in users with permissions to see documents.

Return Parameters

JSON Success Object

{
    "result": "Document Added",
    "code": 1,
    "document_id": "3108"
}

JSON Error Object

{
    "error": "No document provided.",
    "code": -1
}

Errors Possible

Error

Resolution

No API ID Provided

Check API ID in Header or Parameters. See https://esotech.atlassian.net/wiki/spaces/EXTDOC/pages/186744846/API#Using-API-ID-and-API-Key

No API Key Provided

Check API Key in Headers or Parameters. See https://esotech.atlassian.net/wiki/spaces/EXTDOC/pages/186744846/API#Using-API-ID-and-API-Key

Lead ID is required.

Check lead_idParameter

Policy ID is required.

Check policy_idParameter

Lead does not Exist

Check lead_id Parameter

Policy does not Exist

Check policy_id Parameter

Invalid Document Type ID Provided

Check type_id Parameter

No Document provided

Check file sent

Error Inserting Document

Check file sent

  • No labels