How to add attachment to a Sales Order in oracle using Rest Api

To add an attachment to a sales order in Oracle Order Management Cloud, you can follow these steps:

Adding attachment to Sales order from UI

  1. Navigate to the Sales Order page for the order you want to attach a file to.
  2. Edit the Sales Order and click on Actions > Manage Attachments
  3. The Attachments popup screen will show up.
  4. In the “Add Attachment” dialog box, select the file you want to attach from your local computer or network. You can also enter a description for the attachment.
  5. The file type can be URL , FILE or TEXT
  6. Once you have selected the file and entered a description, click the “Upload” button to attach the file to the sales order.
  7. The attachment will now be displayed in the manage Attachments window, along with the date and time it was added, and the name of the user who added it.

Adding Sales Order attachment Via Rest API

To add an attachment to an already existing order you need to query the order first and get the order key. This order key will be passed to the Attachment Api

1. Get the order key

Query the sales order number using the rest api

Example

https://{fadomain}/fscmRestApi/resources/11.13.18.05/salesOrdersForOrderHub?q=OrderNumber= 97486

image dd attachment to a Sales Order in oracle using Rest Api 2

2. Call Sales order Attachment Rest Api

Use the order key to pass it in url paramter to create attachment

https://FADOMAIN/fscmRestApi/resources/11.13.18.05/salesOrdersForOrderHub/OPS:300000258612754/child/attachments

Refer doc

        {
            "AttachedDocumentId": 3000002586124343,
             "DatatypeCode": "WEB_PAGE",
             "Url": "https://www.oracle.com/webfolder/technetwork/tutorials/tutorial/cloud/spotlights/spotlight-20c-otm-gtm.pdf",
            "CategoryName": "MISC",
             "UploadedFileContentType": "pdf",
             "ContentRepositoryFileShared": "false",
            "Title": "OTM WhitePaper",
            "Description": "OTM WhitePaper"
         
        }
image 1 dd attachment to a Sales Order in oracle using Rest Api 3

To attach a File

You can also attache a File using the rest api

Sample Payload to attach file

     {
            "AttachedDocumentId": 3000002586127921,
           
          
            "DatatypeCode": "TEXT",
            "FileName": "Integratin Doc",
            "DmFolderPath": null,
            "DmDocumentId": "UCMFA04084592",
            "DmVersionNumber": "4133395",
            "Url": null,
            "CategoryName": "MISC",
            "UserName": "Miscellaneous",
            "Uri": null,
            "FileUrl": "/content/conn/FusionAppsContentRepository/uuid/dDocID:4133395?download&XFND_SCHEME_ID=1&XFND_CERT_FP=EA6AFF46C3AE16153E2E9FA378FD48D1305FF1B0&XFND_RANDOM=5642166711626153233&XFND_EXPIRES=1675945907985&XFND_SIGNATURE=QOziXnoXrSlI~lbI~dbIjg0dxRLKh7WZpAbPaIMZzSD5QWJo1o~Prosdm~ozL1NSz0VgTd4uUfjis9xHt~YRtKYS6ZxCeZnguOp770R4oUjDJzyGfBx9ZYdL0aAckTZ0dImfgfnn8WzcT-MwS592CvYuyr7gFG5yOr5CLuEiigWE53626~58ORE9utJhbMWRT-9ZFYqKIBJ8RU6nxgv4ug6f0bdKTzL6nRnu1eXQ2iQlnX3u1h7xdE05HoFc6svG6-VNzQ3ZYqYnUm0gtjwWGqtS-mTBuw8gHK~mHlPLlJrH0T9xTHghTqkROkkZHWVD9uLjPWxIt~8aQZXUGytA__&Id=4133395",
            "UploadedText": null,
            "UploadedFileContentType": "text/plain",
            "UploadedFileLength": 17,
            "UploadedFileName": null,
            "ContentRepositoryFileShared": "false",
            "Title": "test",
            "Description": "test",
            "ErrorStatusCode": null,
            "ErrorStatusMessage": null,
             "ExpirationDate": null,
       "AsyncTrackerId": null
             }

The challenge would be frame the File url which should be in the UCM server to make the hyperlink to the attached file.

See how url can be built from a document uploaded in UCM

wpsbutton
We will be happy to hear your thoughts

Leave a reply

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.

Powered By
Best Wordpress Adblock Detecting Plugin | CHP Adblock
Cloud Technologies Blog
Logo
Compare items
  • Total (0)
Compare
0
Shopping cart