mutliple organizations with the same IDs and no access to them

SOLVED
MartinAdolfi
Conversationalist

mutliple organizations with the same IDs and no access to them

I'm trying to use meraki api with curl to get data from some of my organizations. I'm doing it this way but there's 2 strange things>

1) all organizations this apikey has access to have the same exact ID (all but one)

2) I can only access info on the organization that has a different ID...

Here you can see for yourself>

 

marting@SIADM14-N:~$ curl --silent -L -H 'X-Cisco-Meraki-API-Key: xxxxxxxxxxxxxxxxxxxxxxxxxx' -H 'Content-Type: application/json' -X GET 'https://api.meraki.com/api/v0/organizations/' | jq '.'
[
  {
    "id": 708233,
    "name": "BUENOS AIRES #1"
  },
  {
    "id": 635570497412661800,
    "name": "BUENOS AIRES #3"
  },
  {
    "id": 635570497412661800,
    "name": "SANTA FE"
  },
  {
    "id": 635570497412661800,
    "name": "SANTA CRUZ"
  },

... the list keeps going on about 20 more orgs with the same ID, but I don't want to load lots of things here, I'm sure you get the point.

 

Then, if I try to get any info about the first one, it works properly, see>

marting@SIADM14-N:~$ curl --silent -L -H 'X-Cisco-Meraki-API-Key: xxxxxxxxxxxxxxxxxxxxxxxx' -H 'Content-Type: application/json' -X GET 'https://api.meraki.com/api/v0/organizations/708233/' | jq '.'
{
  "id": 708233,
  "name": "BUENOS AIRES #1"
}

This or any other info, networks, devices, everything works awesome with this organization.

But, with any of the others, it wont>

marting@SIADM14-N:~$ curl --silent -L -H 'X-Cisco-Meraki-API-Key: xxxxxxxxxxxxxxxxxx' -H 'Content-Type: application/json' -X GET 'https://api.meraki.com/api/v0/organizations/689613692941107200' | jq '.'
marting@SIADM14-N:~$

Just  to be clear, it's an empty body and a 404... see here for more detail about this repsonse>

marting@dev-marting-3:~$ curl -D - -o /tmp/myfile --silent -L -H 'X-Cisco-Meraki-API-Key: xxxxxxxxxxxxxxxxxxxxxxxxx' -H 'Content-Type: application/json' -X GET 'https://api.meraki.com/api/v0/organizations/635570497412661800' && cat /tmp/myfile
HTTP/1.1 404 Not Found
Server: nginx
Date: Fri, 03 May 2019 20:16:29 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept-Encoding
X-UA-Compatible: IE=Edge,chrome=1
Cache-Control: no-cache
X-Request-Id: 03729927e42cdc44571d45e8fbe46460
X-Runtime: 0.028592

We can see in the dashboard that permissions seem to be set up properly, in all organizations the user has read permission to the organization.

 

Can you help me out here about what's going on here? 

 

Thanks a lot!

 

M.

1 ACCEPTED SOLUTION
jdsilva
Kind of a big deal

OK, yeh that's totally messed up. OrdID is the unique identifier and no two Orgs can have the same ID. 

 

I'm not familiar with that jq tool (though a quick google looks like I should be!), but is that causing any weirdness? If you just output to stdout or to a file does it still show the same orgid for all those orgs?

 

If that's actually what you're getting back from the dashboard then something is really broken. In that case you need to open a case with support. 

View solution in original post

12 REPLIES 12
jdsilva
Kind of a big deal

OK, yeh that's totally messed up. OrdID is the unique identifier and no two Orgs can have the same ID. 

 

I'm not familiar with that jq tool (though a quick google looks like I should be!), but is that causing any weirdness? If you just output to stdout or to a file does it still show the same orgid for all those orgs?

 

If that's actually what you're getting back from the dashboard then something is really broken. In that case you need to open a case with support. 

jdsilva
Kind of a big deal

And one more thought... When you're logged in, what happens if you point your browser at that url?

 

https://api.meraki.com/api/v0/organizations/

 

That's one of the few API endpoints that I can get to work with my browser...

Well, I was going to tell you it's just a json parser and that it didn't hurt, but as soon as was willing to show you the results without it, I realized it DID hurt... don't know why, bit it did... so you guessed it!, thanks a lot!, I should call support, but `jq`s support 😉

 

Here you can see the results without jq and they're totally perfect.

marting@SIADM14-N:~$ curl --silent -L -H 'X-Cisco-Meraki-API-Key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxx' -H 'Content-Type: application/json' -X GET 'https://api.meraki.com/api/v0/organizations/'
[{"id":708233,"name":"BUENOS AIRES #1"},{"id":635570497412661754,"name":"BUENOS AIRES #3"},{"id":635570497412661775,"name":"SANTA FE"},{"id":635570497412661774,"name":"SANTA CRUZ"},{"id":635570497412661770,"name":"RIO NEGRO"},{"id":635570497412661772,"name":"SAN JUAN"},{"id":635570497412661765,"name":"LA PAMPA"},{"id":635570497412661769,"name":"NEUQUEN"},{"id":635570497412661764,"name":"JUJUY"},{"id":635570497412661763,"name":"FORMOSA"},{"id":635570497412661761,"name":"CORRIENTES"},{"id":635570497412661767,"name":"MENDOZA"},{"id":635570497412661758,"name":"CHUBUT"},{"id":635570497412661760,"name":"CORDOBA"},{"id":635570497412661757,"name":"CHACO"},{"id":635570497412661776,"name":"SGO. DEL ESTERO"},{"id":635570497412661753,"name":"BUENOS AIRES #2"},{"id":635570497412661762,"name":"ENTRE RIOS"},{"id":635570497412661755,"name":"BUENOS AIRES #4"},{"id":635570497412661756,"name":"CATAMARCA"},{"id":635570497412661771,"name":"SALTA"},{"id":635570497412661768,"name":"MISIONES"},{"id":635570497412661778,"name":"TUCUMAN"},{"id":635570497412661773,"name":"SAN LUIS"},{"id":635570497412661766,"name":"LA RIOJA"},{"id":635570497412661777,"name":"TIERRA DEL FUEGO"}]marting@SIADM14-N:~$

Thanks a lot , my bad, I really trusted jq... 😞

Haha! 

 

Hey, when in doubt (and troubleshooting) strip it all away down to the bare minimum, and work back from there. 

 

Maybe I won't check out that utility after all...

Thanks! Good to know it's not jq's fault... So it's really a combination of the large id being used as a number, and me not paying enough attention.
Thanks for the clarification.

Indeed, I think it is.

DexterLaBora
Meraki Employee
Meraki Employee

This is being fixed. 

 

Please refer to this post for more details.

 

https://community.meraki.com/t5/Solutions-APIs/Bug-Fix-Organization-ID-type-as-string/m-p/49840#M147...

 

Hello,

 

I think I have the same problem because I get a "not found" error when I try to open /api/v0/organizations/564638803281576275 in SoapUI.

 

How do I specify this as a type of string? In my script I use RestSharp and have the same problem.

have been using this script for a while and have never had any problems with it and have not changed anything.

 

I hope someone can help me with this. Thanks in advance.

The Org ID changes only affected the response body parameter value. You are just specifying the endpoint URL path, which is always a string. 

 

Why it is failing could be a number of reasons, but without seeing the complete request logic, it's hard to determine.

 

Have you used the Postman collection or the live "Try it out" in our API docs? You could use your API key and Org ID to validate an endpoint and check the response. From there, you can safely start implementing your code. 


It worked well, but suddenly I no longer get networks back on this API call. I use SOAPui for testing. This has always worked well. I am sure that the ORG ID is good that I use in the call
/ networks

If I use your http://cs.co/meraki_tools I will see ORG but no Networks.

Perhaps it has to do with the fact that some BETA endpoints have been set on our ORG?


Where can I find the "try it out" in the API docs?

Dexter78
Conversationalist


I think I found it. My account has become a network admin instead of organization admin .....
Get notified when there are additional replies to this discussion.