Help Center
Login Sign up
  1. Home
  2. API reference
  3. API documentation (JSON/XML)
  4. Tasks
  5. Contact document tasks

Contact document create (upload)

API reference (XML/JSON) · Updated 2023-09-27

Function

The ContactDocumentCreate task task creates a new document for a specific document type and assigns it to a contact.
There can be only one document per document type per contact.

If another document is uploaded for the same document type and contact, it will be overwritten for JSON. With XML it is not overwritten automatically. Here the key override must be specified.

Description


Route: POST /contact/{id}/document/{type}

Content-Type: multipart/form-data

form: file=temp/data.pdf
{
    "stid": "20210520-app-4215",
    "status": {
        "code": "S0361",
        "text": "The document for the contact has been successfully stored.",
        "type": "SUCCESS"
    },
    "object": {
        "type": "ContactDocument",
        "value": "1",
        "data": {
            "contact": {
                "id": 45637
            },
            "document": {
                "id": 15234
            },
            "type": "ID_CARD"
        }
    }
}

cURL example

curl --location --request POST 'https://api.autodns.com/v1/contact/12345678/document/ID_CARD' --header 'X-Domainrobot-Context: 4' --user username:password --form 'file=@example.png;type=image/png'