Friday, June 16, 2023

OIC - How to call "upload as attachement REST integration" from another integration in Oracle Integration

Usecase: In my previous blogs, I have shown you how to upload single or multiple attachments in REST API. Here, I will show how to call that exposed REST API service from another integration.

For upload attachment in Rest API:

https://soalicious.blogspot.com/2023/06/oic-upload-attachment-in-rest-api.html

For upload multiple attachments in REST API:

https://soalicious.blogspot.com/2023/06/oic-upload-multiple-attachements-in.html


Logic steps:

  1. Create an OIC self REST invoke connection so that we can call the OIC rest upload attachment service.
  2. Confugure a rest trigger to get the employee details as json.
  3. Take a stage and write a file for example Employee.csv using sample CSV file and map the request employees to the csv file.
  4. Drag and drop the created OIC self connection and configure rest invoke with POST verb and resource URI of the upload attachment rest service. Take the request as multipart form-data.
  5. Map the stage file reference to attachement reference and provide content type as "text/CSV" and partname as filename of the stage write response.

Implementation steps with screenshots:

Create OIC self connection:


Integration flow:



Configure Rest Trigger





Stage to write a file:






Invoke rest upload attachment service






Notes: 
  • Content type should be mapped while invoking to Rest upload attachment integration. This case we have mapped as "text/CSV", otherwise you will get the error:  An error occurred while invoking the rest endpoint .[[Media type is null.]]. The 406 Not acceptable is an HTTP response statue code indicating that the client has requested a response using accept-headers that the server is unable to fulfill.

No comments:

Post a Comment

Featured Post

11g to 12c OSB projects migration points

1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper:   File⇾Import⇾Service Bus Resources⇾ Se...