How to reference UID from an OAuth2 connection

Hey Everyone.

So I hit a dead end in my APP development.

Info
In my Custom App that uses OAuth2 as authentication, I am currently having a hard time on how to use/call the “uid” set in the Info Directive of my connection.

So in info of OAuth2 e.g.
“info” : { “response”: { “uid”: "{{body.id}}}}

I grap the ID of a response and use it in “uid”.

So far so good.
But how do i get this ID in a module?

This is what i have tried.
Create a module, add the above connection, then tried calling:

connection.uid
item.uid
connection.item.uid

But no ID is returned.

So two questions.

1: Is it possible to call the uid from the info > uid of an OAuth2 connection in a module?

2: Often times, I see solutions in this forum, containing code (JSON) with keys (in a lack of a better word) e.g. {{item.something}} or {base.accessTole}.
I have read most of the documentation and used alot time here, searching for a list or post or something, containing a list of what code can be used and where, with a good explanation.
But I havn’t found one yet.

So where do all of you peps learn the ins-and-outs?
Do someone have a nice reference guide with the JSON/Code tbat can be used im base, connection, communication etc. and what goes where and why?

Sorry for the lack of code/images, this is written on my phone. :slightly_smiling_face:

And in advance, thanks for any help.

Hey Myself

I found the answer and of course it was a simple one in the end. sigh

Just want to share the solution, as it is general applicable knowledge of OAuth2 and Make.com in general.

Solution: In the “info” part of the OAuth2 flow, all I needed was to change or encapsulate the “uid” in the “data” directive. Now it is stored with the connect and accessible later on.

Example code:

(Connection part)
Before

"info": {
   "response": {
      "uid": "{{data.id}}",
      "metadata": { ... }
   }
}

After:

"info": {
   "response": {
      "data": {
         "uid": "{{data.id}}",
      },
      "metadata": { ... }
   }
}

Calling the UID now is straight forward.

(Module part)
Example code (URL):

{
   "url": "/billing/accounts/{{connection.uid}}/invoices"
}

What I learned and hope other benefits from this is:

  1. Really pay attention to the tooltip text, when hovering a directive in the Web Code Editor or vs-Code (se image below).
  2. As important to the first point. Thoroughly read/watch Make.com’s documentation and videos, solutions can be really hard to find/spot. What lead me on the right path, in this case was the “Advance App Development”-section of the Special Badge training videos and more precisely, the video regarding oAuth2 Connection at timeframe 06:51

Image of the tooltip.

Hope this will help somebody save time and a headache. :slight_smile:

Kind regards
Riko

2 Likes