Cisco Meraki Guest account creation with Rest API

Gopal
New here

Cisco Meraki Guest account creation with Rest API

I am new to Cisco Meraki, I want to understand that is there any way to create guest account for guest/vistor using Rest api call only?

 

Thanks in advance!

10 Replies 10
JAIROJASH
Here to help

Hello,

 

we are on the same side. I am first documenting the Meraki REST API material with Postman, Python and Github. I attach some links that can give you more idea. We can share experiences in development if you want.

 

https://developer.cisco.com/meraki/build/meraki-postman-collection-getting-started/

 

f you do not have access to a Meraki dashboard organization with networks and devices, you can use this API key: [REMOVED]

 

You render !!

 

Nash
Kind of a big deal

I'd be delighted to be wrong, but all I'm seeing is getNetworkMerakiAuthUsers (all users) and getNetworkMerakiAuthUser (one user at a time). Nothing to create users or delete them.

 

Creating and updating via API would solve a problem for me, so long as one could authorize for client VPN... My boss would go for a widget that my helpdesk could use. My boss will not go for SAML, for reasons.

PhilipDAth
Kind of a big deal
Kind of a big deal

@Nash is correct.  There is no API to create guest user accounts.

Hello !

I have create a guest user account for WLAN Guest.

 

You must use this link :

 

"https://api.meraki.com/api/v1/networks/[Your_Network_ID]/merakiAuthUsers"

 

To get your Network ID in first : 


Get your Organizations ID :  "https://api.meraki.com/api/v1/organizations"

 

And get your network ID : 

("https://api.meraki.com/api/v1/organizations/[Your_Organizations _ID]/networks")

 

For guest user you must specify : accountType="Guest"

 

For Authorizations values you have :

expiresAt="2021-04-15T22:25:29.000000Z";   #### OR  "Never";
ssidNumber=2 ###ID to SSID GUEST
authorizedZone="NAME SSID GUEST"

authorizedByName="the name of the person who created the account"
authorizedByEmail="the e-mail of the person who created the account"

 

For the Guest account :

email = 'Email for the guest account';

name = 'Description Guest account';

password = 'Password';

accountType="Guest";

emailPasswordToUser=false; ## OR True

authorizations=@(Authorizations variable)

Hi when I try this

networkId = "L_658651445502943752"
email = "Mytest35813@hotmail.com"
name = "testuser"
password = "*********"
accountType = "Guest"
emailPasswordToUser = True
isAdmin = False
authorizations = [{"ssidNumber": 10}]
try:
response = dashboard.networks.createNetworkMerakiAuthUser(
networkId,
email,
name,
password,
accountType,
emailPasswordToUser,
isAdmin,
authorizations
)
except APIError as e:
print(e.status)
print(e.reason)
print(e.message)
if response == 201:
print("Account successfully created")
else:
print("Account not created")
I get this error message
response = dashboard.networks.createNetworkMerakiAuthUser(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Networks.createNetworkMerakiAuthUser() takes 4 positional arguments but 9 were given

Try this :

authorizations = [{'ssidNumber': SSI_Num, 'authorizedByName': Host_Name, 'authorizedByEmail': Host_Email}]

try
:
response = dashboard.networks.createNetworkMerakiAuthUser(
network_id, email, authorizations,
name= Guest_Name,
password= password,
accountType='Guest',
emailPasswordToUser=True,
isAdmin=False
)

With this code Guest access will never expire , you can use "expiresAt' in authorizations list and define time & expiry date in ISO format

Amit many thanks that works. I don't under the difference. You are still passing more than four items but hey thats coding

Amit_pal
Getting noticed

How can we let meraki generate password for guest users, instead of defining it as a string ?

This would be good to know for sure. Transferring passwords as cleartext will be too insecure IMO. 

Get notified when there are additional replies to this discussion.
Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.