Upload image for a contact through API-Rest call

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wtconseil
    Active Community Member
    • Apr 2015
    • 335

    Upload image for a contact through API-Rest call

    Hi

    I have an external form for my leads. When submitting the form, it calls espo CRM APIs to create the contact.
    I'd like to upload through Espo CRM API an image (submitted from my form).

    I check that there is some endpoint like POST v1/Attachment/action/upload
    then PUT api/v1/Attachment/5593f310eb6d6636d

    Then PATCH request to set up my FieldID, FiledName

    Is there a way to make all these steps easy ?


  • yuri
    Member
    • Mar 2014
    • 8467

    #2
    Hi

    Yes. But you can also achieve the same w/o the first step.
    POST api/v1/Attachment
    with file base64 encoded contents
    See
    application/Espo/Services/Service.php

    And then PATCH
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    Working...