API Reference
Log inSign up
v1.7.3
v1.7.3
  • ComplyCube API Reference
  • Integration
  • Test and Live
  • Authentication
  • Rate Limits
  • Service Quota
  • Errors
  • Pagination
  • Filtering
  • Versioning
  • Core resources
    • Clients
      • Create a client
      • Get a client
      • Update a client
      • Delete a client
      • List clients
      • Filtering clients
    • Addresses
      • Create an address
      • Get an address
      • Update an address
      • Delete an address
      • List addresses
      • Filtering addresses
    • Documents
      • Create a document
      • Get a document
      • Update a document
      • Upload image attachment
      • Delete image attachment
      • Download image attachment
      • Redact image attachment
      • Delete a document
      • List documents
      • Filtering documents
    • Live Photos
      • Upload a live photo
      • Get a live photo
      • Download live photo
      • Redact live photo
      • Delete a live photo
      • List live photos
    • Live Videos
      • Get a live video
      • Redact live video
      • Delete live video
      • List live videos
    • Checks
      • Create a check
      • Get a check
      • Update a check
      • Validate check outcome
      • Redact check outcome
      • List checks
      • Filtering checks
    • Risk Profile
      • Get a risk profile
  • Check types
    • AML Screening Check
    • Document Check
    • Identity Check
    • Enhanced Identity Check
    • Proof of Address Check
    • Multi-Bureau Check
    • Face Authentication Check
    • Age Estimation Check
  • Lookups
    • Company Search
      • Search company
      • Get company details
    • Address Search
      • Search address
  • Tools
    • Custom Lists
      • Get a custom list
      • Add entity to custom list
      • List custom lists
  • Static Data
    • Screening Lists
    • Supported Documents
  • Other Resources
    • Flow (Hosted Solution)
      • Create a session
    • Webhooks
      • Create a webhook
      • Get a webhook
      • Update a webhook
      • Delete a webhook
      • List webhooks
      • Filtering webhooks
    • SDK Tokens
      • Generate a token
    • Autofill
      • Perform autofill
    • Reports
      • Generate a client report
      • Generate a check report
    • Team Members
      • Get a team member
      • List team members
      • Filtering team members
    • Audit Logs
      • Get an audit log
      • List audit logs
      • Filtering audit logs
    • Account Info
      • Get account info
  • Useful Resources
    • Testing Data
    • User Docs
Powered by GitBook
On this page
  • URL
  • Headers
  • Path parameters
  • Body
  • Example request
  • Example responses

Was this helpful?

  1. Core resources
  2. Documents

Upload image attachment

URL

POST https://api.complycube.com/v1/documents/:id/upload/:documentSide

Associates an image attachment to an existing document. The images must be either in JPG, PNG, or PDF format. Each side of the document must be between 34 KB and 4 MB.

Headers

Name
Type
Description

Content-Type*

string

The content-type must always be set to application/json.

Authorization*

string

The API live or test key.

Path parameters

Name
Type
Description

documentSide*

string

The side of document being attached. Valid values include: 1. front 2. back

id*

string

The ID of the document.

Body

Name
Type
Description

fileName*

string

The file name. It must end with .jpg, .jpeg, .png, or .pdf.

data*

string

The BASE64 encoded data.

Example request

curl -X POST https://api.complycube.com/v1/documents/{:documentId}/upload/{:documentSide} \
     -H 'Authorization: <YOUR_API_KEY>' \
     -H 'Content-Type: application/json' \
     -d '{
          	"fileName": "front-test.jpg",
          	"data": "<BASE64_DATA_CONTENT>"
        }' 
const { ComplyCube } = require("@complycube/api");

const complycube = new ComplyCube({ apiKey: "<YOUR_API_KEY>" });

await complycube.document.upload("DOCUMENT_ID", {
      fileName: "front-test.jpg",
      data: "<BASE64_DATA_CONTENT>"
}, "DOCUMENT_SIDE");
from complycube import ComplyCubeClient
cc_api = ComplyCubeClient(api_key='<YOUR_API_KEY>')

doc_front = {
    'fileName': 'passport_front.jpg',
    'data': '<BASE_64_ENCODED>'
}

img = cc_api.documents.upload('DOCUMENT_ID','DOCUMENT_SIDE',**doc_front)
use ComplyCube\ComplyCubeClient;

$ccapi = new ComplyCubeClient('<YOUR_API_KEY>');

$img = $ccapi->documents()->upload('DOCUMENT_ID', 'front', [
    'fileName' => 'passport_front.jpg',
    'data' => '<BASE64_CONTENT>'
]);
using ComplyCube.Net;
using ComplyCube.Net.Resources.Documents;
using ComplyCube.Net.Resources.Images;

var docApi = new DocumentApi(new ComplyCubeClient("<YOUR_API_KEY>"));

var docFront = new ImageRequest {
  fileName = "front-test.jpg",
  data = "<BASE64_CONTENT>"
};

var img = await docApi.UploadImageAsync("DOCUMENT_ID", "front", docFront);

Example responses

{
    "id": "5eb169302d868c0008828591",
    "fileName": "front-test.jpg",
    "documentSide": "front",
    "downloadLink": "/documents/5eb158880c19580007310f22/images/5eb169302d868c0008828591/download",
    "contentType": "image/jpg",
    "size": 72716,
    "createdAt": "2020-01-04T17:24:29.146Z",
    "updatedAt": "2020-01-04T17:24:29.146Z"
}
{
    "type": "invalid_request",
    "message": "Image file size should be between 34KB and 4MB",
    "param": "data"
}
PreviousUpdate a documentNextDelete image attachment

Last updated 1 year ago

Was this helpful?