How to Get Google API Access Token Using JavaScript?

Hey there @Jagdish_Parmar,

You can definitely build a dynamic rest resource. This is not my specialty, and most likely the below suggestion isn't the most proper way of doing it, but it may guide you in the right direction.

Your javascript can either return all of the dynamic values that your rest resource will use, OR can set them in variables that you can reference in your resource, e.g.

As you can see, the url is dynamically built using variables (this can actually be values returned by your javascript query OR even data available from your components).

As visible, you can also add your binary data in the body, it is just a matter of creating a result/variable that can be referenced in your rest resource.

By doing this, your token is stored in the resource and it is used in the header whenever it runs. Once it expires, you will only need to re-authenticate the resource once again.

Hope this makes sense.