Authorization for "Administered Orgs deep link"

Solved
Zendev
Comes here often

Authorization for "Administered Orgs deep link"

Hi, 

 

In an automation script, I need to know the eid of networks.
 
 
Only, this endpoint seems to take according to the user logged on the dashboard and does not take into account the X-Cisco-Meraki-API-Key if we want to query the endpoint.
 
I wanted to know if there was a way to get the eid of the networks in API in order to automate (and integrate the new networks)
 
Thanks
1 Accepted Solution
RomanMD
Building a reputation

as I have explained:

retrieve one device of each type and substract the EID from each URL. If this will be an Access point - the EID will be valid for wireless. 

 

The only problem as I see here is a combined network with no devices.

View solution in original post

14 Replies 14
RomanMD
Building a reputation

The way I am doing it:

Fetch all orgs with endpoint: https://api.meraki.com/api/v1/organizations

Parse all orgs and fetch all networks with: https://api.meraki.com/api/v1/organizations/{organizationId}/networks

 

On the other hand - X-Cisco-Meraki-API-Key is the API key of a particular dashboard user, therefore please make sure that your user has access to all your organizations that you need to see.

Zendev
Comes here often

Thanks for your answer.

But, the /organizations/{orgId}/networks don't return the eid like this URL https://api.meraki.com/manage/organization/administered_orgs ...

RomanMD
Building a reputation

the Organization endpoint returns the URL to the organization

the Networks endpoint returns the URL to the network, where the YYYYYYY is the EID

{'enrollmentString': None,
'id': 'N_6xxxxxxxxxxxxxxxxxx0',
'name': 'MY NETWORK NAME',
'notes': '',
'organizationId': '6xxxxxxxxxxxxxxxxxx0',
'productTypes': ['appliance'],
'tags': ['mytag'],
'timeZone': 'Europe/Bucharest',
'url': 'https://nXXX.meraki.com/MY NETWORK NAME/n/YYYYYYY/manage/usage/list'},

 

 

Zendev
Comes here often

@RomanMD There are several eid for a network ...

RomanMD
Building a reputation

I don't think so.

Each organization and network should only have one ID and one EID. 

For the automation purposes ID is used. If you want to build the links to the networks/devices then you can substract the EID from the URL of the organization or URL of the network as I have explained above. 

 

But of course, if you say that this does not work for you, I don't know another way...

Zendev
Comes here often

@RomanMD thanks for your answer.

 

For example, for one network, the endpoint https://api.meraki.com/manage/organization/administered_orgs return three eid : one for appliance, one for switch and one for wireless.

 

And, to use deep links i need the eid of appliance (for example) and not the "global" ID of the network (that is called the locale_id)

RomanMD
Building a reputation

and what is the problem to list one device and substract eid from the URL?

 

{'address': '',
'firmware': 'wired-14-53',
'url': 'https://n333.meraki.com/NetworkName/n/xxxxxdbd/manage/nodes/new_list/57239045832485'}

{'address': '',
'firmware': 'switch-11-22',
'url': 'https://n333.meraki.com/NetworkName/n/xxxxxcbd/manage/nodes/new_list/457203458394437'}
Zendev
Comes here often

The problem is that the endpoint organizations/{orgid}/networks/ return only one url.

And, the EID in this url can be the eid of wireless.

 

An example : 

https://api.meraki.com/api/v1/organizations/37125365/networks/L_237283

 

 

{
        "id": "L_237283",
        "organizationId": "37125365",
        "name": "LABOTEST",
        "productTypes": [
            "appliance",
            "switch",
            "wireless"
        ],
        "timeZone": "Europe/Paris",
        "tags": []
        ],
        "enrollmentString": null,
        "url": "https://n147.meraki.com/LABOTEST/n/jLYp_l3/manage/usage/list",
        "notes": ""
 }

 

 

 

And, https://api.meraki.com/manage/organization/administered_orgs

 

 

{
    "37125365": {
        "id": "37125365",
        "eid": "daQQac",
        "uid": "54321159657987623231",
        "org_admin_type": "write",
        "name": "OrgNAME",
        "num_networks": 1263,
        "block_meraki_admins": false,
        "licensing_mode": 0,
        "node_groups": {
            "jLYp_l3": {
                "id": "237283",
                "n": "LABOTEST - wireless",
                "t": "LABOTEST",
                "eid": "jLYp_l3",
                "locale_id": "237283",
                "network_type": "wireless"
            },
            "dPQA_d8": {
                "id": "237397",
                "n": "LABOTEST - appliance",
                "t": "LABOTEST",
                "eid": "dPQA_d8",
                "locale_id": "237283",
                "network_type": "appliance"
            },
            "abc_De": {
                "id": "237425",
                "n": "LABOTEST - switch",
                "t": "LABOTEST",
                "eid": "abc_De",
                "locale_id": "237283",
                "network_type": "switch"
            }
        }
    }
}

 

 

 

RomanMD
Building a reputation

as I have explained:

retrieve one device of each type and substract the EID from each URL. If this will be an Access point - the EID will be valid for wireless. 

 

The only problem as I see here is a combined network with no devices.

Zendev
Comes here often

Ok I hadn't thought of that at all!
thank you so much
 
For information (you must use /organizations/{orgID}/devices)

Interesting, the eid isn't needed when you use the public API, so what's the eid give you? What problem does having the eid solve?

I needed to create a deep link for the appliance. And, the problem is that the network don't return all urls.
 
Ultimately, it comes down to recovering all of the devices (and associated urls). 
But when i retrieve /devices I can also retrieve the mac address and use the deep link for the mac.
 
In reality, which would have been perfect is to have a deep link for the serial
John_on_API
Meraki Employee
Meraki Employee

This is a private endpoint. Why not use the public ones?

 

Private endpoints are subject to change anytime, which could totally break your application, so building on public endpoints is the better bet.

Thanks for the tip @John_on_API, but what public API does this do?

Get notified when there are additional replies to this discussion.