how to get user ids from meraki

Solved
R0g3r
Here to help

how to get user ids from meraki

Hello everyone

 

We are using meraki wifi with guest user via splash login. I want to delete these users when they are expired.

I used this documentation: https://developer.cisco.com/meraki/api-v1

 

I found this method to delete them:

https://developer.cisco.com/meraki/api-v1/#!delete-a-user-and-all-of-its-authentication-methods

 

My problem is I don't know how to get the userid. There is no GET for users as far as I can see.

There is only the method "merakiAuthUsers" where I get an ID, and the ID is just base64 hashed "email,accountType".

 

TLDR: How can I get the user id to delete it with "deleteOrganizationUser"?

 

Thank you very much

R0g3r

1 Accepted Solution
R0g3r
Here to help

I asked the support and this is not possible at the moment.

With this method you can only delete organizations admin:

https://developer.cisco.com/meraki/api-v1/#!delete-a-user-and-all-of-its-authentication-methods

 

Unfortunatly, for meraki auth user there is only a deauthorize method, but no delete method.

View solution in original post

7 Replies 7
Inderdeep
Kind of a big deal
Kind of a big deal

@R0g3r : Are you looking for below To get a list of all existing authorized users
https://developer.cisco.com/meraki/api-v1/#!list-the-users-configured-under-meraki-authentication-fo... 

 

Also check
https://api.meraki.com/api/v1/networks/<networkID>/merakiAuthUsers/<UserID> 

Regards/Inder
Cisco IT Blogs awarded in 2020 & 2021
www.thenetworkdna.com

Thank you for your fast response. Unfortunatly, that is not working. As an example I run this command:

https://developer.cisco.com/meraki/api-v1/#!list-the-users-configured-under-meraki-authentication-fo...

 

with this output:

[
    {
        "id": "aGlAaGkuY29t",
        "email": "miles@meraki.com",
        "name": "Miles Meraki",
        "createdAt": "2018-02-11T00:00:00.090210Z",
        "accountType": "Guest",
        "isAdmin": false,
        "authorizations": [
            {
                "ssidNumber": 1,
                "authorizedZone": "Store WiFi",
                "expiresAt": "2018-03-13T00:00:00.090210Z",
                "authorizedByName": "Miles Meraki",
                "authorizedByEmail": "miles@meraki.com"
            }
        ]
    }
]

 

Next step is I take this Id and run this:

https://api.meraki.com/api/v1/organizations/<organizationId>/users/aGlAaGkuY29t
 
Then I receive: "The remote server returned an error: (404) Not Found."
Therefore I believe I don't get the correct ID or this is the merakiAuthUserID but no the userId needed for deleteOrganizationUsers.
 
Kind regards
R0g3r

 

 

 

are you talking about client ids? like the client ids Meraki assigns to each user?

 

for example:

client_ids = ['k123456', 'k789abc', 'kabcde1', 'k01abcde']

Probably not, but I would try it netherless 🙂

How do I get the client_id for a user?

 

This endpoint:
https://developer.cisco.com/meraki/api-v1/get-network-clients/

will show all unique ids that have used a network during a specific timespan. Once you get the ids, put them in a 'list' and you can use them with other endpoints.

This give me the clients, but I need the user. I guess the support is right, there is no way at the moment. Netherless, thank you very much.

R0g3r
Here to help

I asked the support and this is not possible at the moment.

With this method you can only delete organizations admin:

https://developer.cisco.com/meraki/api-v1/#!delete-a-user-and-all-of-its-authentication-methods

 

Unfortunatly, for meraki auth user there is only a deauthorize method, but no delete method.

Get notified when there are additional replies to this discussion.