Ingress Documents

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,application/json

Response Codes

200: Success and Warnings

400: Error

Allowed File Extensions

7z, avi, bmp, doc, docx, gif, jpeg, jpg, json, mov, m4a, mp3, mp4, mpg, mpeg, ogg, ogv, pdf, png, rar, tiff, txt, wav, xls, xlsx, zip

Allowed File MIME Types

application/pdf, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/zip, application/x-7z-compressed, application/x-rar-compressed, application/json

audio/wav, audio/x-wav, audio/mp4, audio/mpeg, audio/ogg, video/ogg

image/jpeg, image/gif, image/png, image/bmp, image/tiff

text/plain

video/mp4, video/quicktime, video/x-msvideo

Upload: Add a Document to a Lead

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

Parameter

Required

Format

Description

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

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

Alternate File Parameters

If you can’t send using multipart/form-data you an send a generic post with the Base64 Encoded String as a Value in the following two formats. It is even possible to send this as JSON.

Format 1

Parameter

Required

Format

Description

Parameter

Required

Format

Description

file

string, base64 | string, data-uri

Your file can be based as Raw Base64 Encoded Data or Bae64 Encoded data in Data URI format data:content/type;base64,YourBase4DataHere Our content-types for Data URI do support the @file/type prefix if needed. This MIME Data is ignored and we resort to checking the file for MIME Type

name

string

The file name including the extension for example sample-file.pdf

JSON Request Object - Base64

JSON Request Object - Data URL Base64

Format 2

Parameter

Required

Format

Description

Parameter

Required

Format

Description

file.data

string, base64 | string, data-uri

Your file can be based as Raw Base64 Encoded Data or Bae64 Encoded data in Data URI format data:content/type;base64,YourBase4DataHereOur content-types for Data URI do support the @file/type prefix if needed. This MIME Data is ignored and we resort to checking the file for MIME Type

file.name

string

The file name including the extension for example sample-file.pdf

JSON Request Object - Base64

JSON Request Object - Data URL Base64

Errors Possible

Error

Resolution

Error

Resolution

No API ID Provided

Check API ID in Header or Parameters. See API | Using API ID and API Key

No API Key Provided

Check API Key in Headers or Parameters. See 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