Thursday, July 6, 2023

OIC -Upload file to UCM using Rest service

Usecase: Here I will show you how to create a csv file into stage and upload the file to UCM using rest service.

Rest service URI used:

/fscmRestApi/resources/11.13.18.05/erpintegrations

Sample request payload:

{

  "OperationName":"uploadFileToUCM",

  "DocumentContent":"UEsDBBQAAAAIABCInEgIHJSKCgAAAAgAAAAIAAAAdGVzdC50eHRzTEpWCEktLgEAUEsBAh8AFAAAAAgAEIicSAgclIoKAAAACAAAAAgAJAAAAAAAAAAgAAAAAAAAAHRlc3QudHh0CgAgAAAAAAABABgAW4FRYEGh0QEBIE9gQaHRAckeCWBBodEBUEsFBgAAAAABAAEAWgAAADAAAAAAAA==",

  "DocumentAccount":"fin$/payables$/import$",

  "ContentType":"zip",

  "FileName":"Test.zip",

  "DocumentId":null

}

About Request parameters:

  • OperationName: uploadFileToUCM
  • Document content: base64 encoded file. Here, I have used oraext:encodeReferenceToBase64() to encode from file reference to base64.
  • DocumentAccount: "fin$/payables$/import$" >> anyone you need
  • Content type: Document or zip
  • Filename : give the file name which to be uploaded to UCM


Detailed steps with screenshots:

Create a rest connection 



Integration flow:


Create a csv file into stage:







Call rest service to upload file:






References:


No comments:

Post a Comment

Featured Post

OIC - how can I use XSLT functions to remove leading zeros from numeric and alphanumeric fields?

To remove leading zeros from an numeric field in Oracle Integration Cloud (OIC) using XSLT, you can Use number() Function The number() funct...