How to up files with Bitrix24 api

367 views Asked by At

How can I update a CRM contact field, this field is type file? I'm using the bitrix24 API

I want to update an image of a contact, in the bitrix23 documentation I can't find anything

This is where I am making the request: {{url}}/{{token}}/crm.contact.update.json?{{paramams}}}

I tried to send a base64 via parameters and also via form-data, the other fields update, but the image does not update.

I don't know if I have to do any process before, to make it work.

Here is an example of what I am sending in the image: fields[UF_CRM_QR_CODE][fileData] = ["image.png","{{base64}}"]

1

There are 1 answers

0
usersuper On

Here is an example of how it works in JS: https://training.bitrix24.com/rest_help/js_library/rest/files.php

For CRM fields need use syntax

"UF_CRM_QR_CODE": {"fileData": ["1.jpg", "R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="]}

Which tool or language are you using to send the request? You need to use POST request