API Access denied

Hello,

I made an API token with all read scopes. Then I tried this curl:

curl --location 'https://eu1.make.com/api/v2/scenarios/consumptions?teamId=12XXXX&organizationId=95XXXX' \
--header 'Authorization: e99XXXX-XXXX-44af-8343-XXXXXXXX'

and get this:

{
    "detail": "Access denied.",
    "message": "User is not logged in.",
    "code": "IM015"
}

Hello @TylonHH,

One thing I’ve noticed so far here is the Authorization header. It should be more like
‘Authorization: Token e99XXXX-XXXX-44af-8343-XXXXXXXX’

Seems you’re just missing the word Token in there.
Maybe give that a try and see if it helps!

2 Likes

I tried that also, with less luck

curl --location 'https://eu1.make.com/api/v2/scenarios/consumptions?teamId=XXXXX&organizationId=XXXXX' \
--header 'Authorization: Token e99XXXX-XXXX-44af-8343-XXXXXX'
{
    "detail": "Not authorized.",
    "message": "Access denied",
    "code": "SC401"
}

Is there a full list of all codes? I dont find the given code here: https://www.make.com/en/api-documentation/http-status-codes

I also added:

–header ‘Content-Type: application/json’ \

Actually, you need to be on a paid plan to use Make API.
Can you confirm that before going into this further?

2 Likes

yes, sir

Current plan - Core
Right now I’ testing the connectiong with all scopes enabled

What does User is not logged in. (IM015) mean

I’m not really sure, not used this specific function before.

What I would do, and I would if I had the time right now, is get it working in Postman then copy the cURL from there.

2 Likes

I’m working with postmen :smiley:

LOG

GET https://eu1.make.com/api/v2/users/me
401
96 ms
GET /api/v2/users/me HTTP/1.1
Content-Type: application/json
Authorization: XXXXX-8d25-4907-8dcf-XXXXXX
User-Agent: PostmanRuntime/7.35.0
Accept: */*
Postman-Token: XXXX-78b3-49d0-b820-XXXXX
Host: eu1.make.com
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
 
HTTP/1.1 401 Unauthorized
Date: Sun, 10 Dec 2023 19:58:49 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 77
Connection: keep-alive
X-RateLimit-Limit: 10000
X-RateLimit-Remaining: 9999
X-RateLimit-Reset: 1702238390
Set-Cookie: userId=; Path=/; Expires=Thu, 01 Jan 1970 00:00:00 GMT
Set-Cookie: sid=; Path=/; Expires=Thu, 01 Jan 1970 00:00:00 GMT
authType: session
api-version: 4.22.0
CF-Cache-Status: DYNAMIC
Server: cloudflare
CF-RAY: 83381099691XXXXX-TXL
 
{"detail":"Access denied.","message":"User is not logged in.","code":"IM015"}

Interesting… I Just tried cURL from command line on Mac and it worked for me.

When I get the incorrect org ID I get a 403 error.

3 Likes

@Michaela please have a look

Also I should mention I’m in US so might be a server issue.
I don’t have an EU account to test with right now, sorry.

I also don’t see Token after Authorization in your last Postman result, but I don’t know if Postman omitted it.

I omitted “Token” from my Authorization string then it gave me an error: User is not logged in. Code IM015.

You might want to create a ticket.

1 Like

THAT was a good hint. You said you’re US.
So I checked the url of my webclient url. It’s

https://eu2.make.com/user/api

So I changed the POST url to eu2 and voilá

Status: 200 OK

:partying_face: :party_blob: :tada: :meow_party:

Heya @TylonHH :wave:

Awesome to see that you found out what was causing this with the assistance of @Donald_Mitchell! Sometimes it really is the littlest things that solve the big questions, right?

Anyway, thanks a lot for stepping back into the thread and sharing the details of the problem and how you resolved it. Much much appreciated :pray:

2 Likes