- Start
- API-Referenz
- API-Dokumentation (XML/ JSON)
- Auftragstypen
- Contact Document Auftragstypen
Contact Document Create (Upload)
Funktion
Der Auftragstyp ContactDocumentCreate legt ein neues Dokument für einen bestimmten Dokumenttyp an und weist es einem Kontakt zu.
Es kann pro Dokumenttyp nur ein Dokument pro Kontakt geben.
Wird für den gleichen Dokumenttyp und Kontakt ein weiteres Dokument hochgeladen, wird dieses bei JSON überschrieben. Bei XML wird es nicht automatisch überschrieben. Hier muss der Key
override mitgegeben werden.Beschreibung
Route: POST /contact/{id}/document/{type}
Content-Type: multipart/form-data
form: file=temp/data.pdf{
"stid": "20210520-app-4215",
"status": {
"code": "S0361",
"text": "Das Dokument für den Kontakt wurde erfolgreich hinterlegt.",
"type": "SUCCESS"
},
"object": {
"type": "ContactDocument",
"value": "1",
"data": {
"contact": {
"id": 45637
},
"document": {
"id": 15234
},
"type": "ID_CARD"
}
}
}
Auftragstyp-Code: 0361
Verwendet Objekt ContactDocument
<request>
<auth>
<user>customer</user>
<password>password</password>
<context>4</context>
</auth>
<task>
<code>0361</code>
<contact_document>
<contact>
<id>45637</id>
</contact>
<type>IDCARD</type>
<document>
<data><![CDATA[PGNvbnRlbn ... FDQT==]]></data>
</document>
</contact_document>
<key>override</key>
</task>
</request><response>
<result>
<data/>
<status>
<code>S0361</code>
<text>Das Dokument für den Kontakt wurde erfolgreich hinterlegt.</text>
<type>success</type>
<object>
<type>contact_document</type>
<value>6556</value>
</object>
</status>
</result>
<stid>20210520-app-6442</stid>
</response>
cURL-Beispiel
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'