File Upload : Contact/Event/Opportunity/Organisation

  • Updated

FileUpload


POST /api/rest/v2/files/upload

This API returns a file uploaded by user and it's details.


Params:-
allowOverWrite    boolean

If true, an existing file with the same file name for given contact will be replaced by the new file.

module    String

Module name (possible values: Contact, Event, Opportunity, Organisation).

id   Long

Id of the module for whom the file is uploaded. 

Note: File to be uploaded need to be provided in binary format and content type should be multipart/form-data.

Query Parameters
allowOverWrite: false
module:Contact
id: 1006451
Form Data
File:contactList.pdf

Response:
{
    "result": {
        "Origin": "File",
        "EmailId": "",
        "NoteId": "",
        "CreatedBy": {
            "PriavaUserId": 1000882,
            "Inactive": false,
            "Id": 1000882,
            "Name": "John Smith",
            "APIUserType": ""
        },
        "FileName": "contactList.pdf",
        "OrganisationId": "",
        "DateCreated": "09/07/2020 17:40",
        "ContactId": 100619451,
        "ModifiedBy": {
            "PriavaUserId": 1000882,
            "Inactive": false,
            "Id": 1000882,
            "Name": "John Smith",
            "APIUserType": ""
        },
        "OpportunityId": "",
        "FileType": "PDF File",
        "TicketingOrderNo": "",
        "EventId": "",
        "Id": 457916,
        "DateModified": "09/07/2020 17:40",
        "FileSize": 3028
    },
    "success": true
}
 

Was this article helpful?

Have more questions? Submit a request