Sage CRM 2022 R2: RESTful API Expansion: File Upload enhancement

1 minute read time.

In Sage CRM 2022 R2 we have extended the REST API to allow a developer to specify a target folder for the uploaded files. The ability to upload files had been added to the REST API in Sage CRM 2021 but the file would only be uploaded into a temporary folder.

We have now added a hiddenUserFolder parameter to the Upload a file to a folder endpoint.

You can use this optional parameter to specify the name of a subfolder in <Sage CRM installation folder>\Library\ to upload the specified file to. If the subfolder does not exist, the endpoint creates it.

The upload method is shown being used in Postman below.

The file to be uploaded is attached using the POST section 'hiddenFileUpload' field and the target folder is 'hiddenUserFolder'

If the upload is successful then a status of 'Success' will be returned.

See also: Sage CRM 2021 R1: RESTful API Expansion - Managing documents https://www.sagecity.com/sage-global-solutions/sage-crm/b/sage-crm-hints-tips-and-tricks/posts/sage-crm-2021-r1-restful-api-expansion---managing-documents

Note: If you omit the hiddenUserFolder parameter, the file is uploaded to <Sage CRM installation folder>\Library\TEMP\<SID>, where <SID> is the session ID you use to authenticate your call.

By default, Sage CRM is installed to %ProgramFiles(x86)%\Sage\CRM\CRM.

To try out the hiddenUserFolder parameter, use a Postman collection provided for Sage CRM 2022 R2:

  1. Import the .json files from the Postman collection into Postman.
  2. Configure Postman as described in the Sage CRM 2022 R2 REST API reference.
  3. In the imported collection, expand the RESTful API endpoints (formerly SData) folder.
  4. Run the first request to obtain a session ID.
  5. Run the Upload a file to a folder request.
Parents
  • Hii,

    I need one help in REST Web API i.e. how can we have two condition in same get URL, for example I have to pass assigned user id and project name too in same condition.

    For example, if there is project entity, I want all the project which is assigned to User id : 1 and also need to find the project that contains name as '%Designer%'. I tried below URL but I am not getting any proper result:

    .../sdata/CRMj/sagecrm/-/vProjectSummary?where=proj_userid eq '1' and proj_name LIKE '%Designer%'

    Any quick assistance will be highly appreciated

Comment
  • Hii,

    I need one help in REST Web API i.e. how can we have two condition in same get URL, for example I have to pass assigned user id and project name too in same condition.

    For example, if there is project entity, I want all the project which is assigned to User id : 1 and also need to find the project that contains name as '%Designer%'. I tried below URL but I am not getting any proper result:

    .../sdata/CRMj/sagecrm/-/vProjectSummary?where=proj_userid eq '1' and proj_name LIKE '%Designer%'

    Any quick assistance will be highly appreciated

Children