Content and Experience

Get Involved. Join the Conversation.


    Luis Garcia
    REST API for Documents
    Topic posted June 18, 2019 by Luis Garcia, last edited June 18, 2019, tagged Content Management 
    124 Views, 1 Comment
    REST API for Documents
    Uploading documents

    Can somebody please share a syntax example of how to upload a file? I've got a working Bearer Token and a URL for the site, a parent folder where to host and a file itself. I just don't understand how the multipart/form-data content type should be type. Does this work with a single curl call?

    I'm trying this syntax

    curl -i -H 'Authorization: Bearer tokenValue' -F 'parentID: F6F9E06748241C3CBB2DEF2EF6C3FF17C1177A968060' -F 'primaryFile:another-sample.txt' POST

    and I'm getting the following curl error

    Warning: Illegally formatted input field!
    curl: option -F: is badly used here
    curl: try 'curl --help' for more information