Question

Creating an attachment in FSM using a secured url response

  • 16 November 2021
  • 2 replies
  • 132 views

Userlevel 4
Badge +9
  • Sidekick (Partner)
  • 59 replies

Hello Experts,

I am trying to create an attachment in FSM using a base64 response that I get by calling an endpoint.

The endpoint I call to get the attachment data is a secured one and looks like following,
 



Now,
In the documentation for the OData attachment endpoint it states the following,



Attempt 1
I tried using the base64 response in the OData attachment endpoint as following,



Although it returns success, it creates an empty attachment record without an actual file




Attempt 2

I tried to create the attachment by providing the http endpoint that retrieves the binary data in the OData attachment post payload as following,


As you can see it returned an unauthorized error, since this is an authorized endpoint that requires a token for authentication. I have successfully tested with a public url of an image (which does not require authorization) in place of the above and it successfully creates an attachment in FSM.

So this is where I stand now. I feel like I have relevant parts working separately, but I’m at a loss on how to get this to work together
i.e

 

  • I can send a unsecured 3rd party url against “attachment@odata.mediaEditLink” and create an attachment in FSM
  • I can make an authorized call to a secure 3rd party url to retrieve the base64 response

How do I make an authorized call to a secured url (which give me a base64 response), and create an attachment in FSM? 

Any help would be greatly appreciated!

  


2 replies

Userlevel 4
Badge +9

@Saranga Amaraweera Do you have any idea on this mate?

Userlevel 7
Badge +22

@Saranga Amaraweera Do you have any idea on this mate?

Hi @Miraj let me check on this and get back to you.

Reply