Cloud Managed Networks

 View Only
last person joined: yesterday 

Forum to discuss all things related to HPE Aruba Networking Central and UXI Network Management, including deployment of managed networks, configuration, best practices, APIs, Cloud Guest, AIOps, Presence Analytics, and other included Applications
Expand all | Collapse all

I can't create a guest user through the Aruba Central API.

This thread has been viewed 39 times
  • 1.  I can't create a guest user through the Aruba Central API.

    Posted Jul 02, 2024 05:52 PM

    Hi everyone,

    I'm working with the following endpoint: guest/v1/portals/{portal_id}/visitors to create a guest user on the network. However, I can't create it because I only get a 500 error without any further details.

    Here is the JSON body I am testing. I have modified it many times, but when making the request, there is no clear response.

    {
      "name": "string",
      "id": {},
      "company_name": {},
      "user": {
        "phone": {},
        "email": {}
      },
      "is_enabled": true,
      "valid_till_no_limit": false,
      "valid_till_days": 1,
      "valid_till_hours": 0,
      "valid_till_minutes": 0,
      "notify": false,
      "notify_to": "email",
      "password": {},
      "status": true,
      "created_at": {},
      "expire_at": {}
    }

    I look forward to your comments.



  • 2.  RE: I can't create a guest user through the Aruba Central API.

    Posted Jul 03, 2024 11:02 AM

    You should just enter the fields that you want to fill (or are mandatory, like name). This example works for me:

    {
      "name": "via-api3@arubadomain.com",
      "user": {
          "phone": null,
          "email": "via-api@arubaarubadomain.com"
      },
      "is_enabled": true,
      "valid_till_days": 1,
      "password": "secret-passwd123"
    }

    When I tried to create a duplicate user, where the "name" fielf exists already, I also get the 500 error.

    Hopefully this sample will get you started...



    ------------------------------
    Herman Robers
    ------------------------
    If you have urgent issues, always contact your Aruba partner, distributor, or Aruba TAC Support. Check https://www.arubanetworks.com/support-services/contact-support/ for how to contact Aruba TAC. Any opinions expressed here are solely my own and not necessarily that of Hewlett Packard Enterprise or Aruba Networks.

    In case your problem is solved, please invest the time to post a follow-up with the information on how you solved it. Others can benefit from that.
    ------------------------------



  • 3.  RE: I can't create a guest user through the Aruba Central API.

    Posted Jul 05, 2024 06:14 PM

    Thank you very much, I will try it and comment on the result here.




  • 4.  RE: I can't create a guest user through the Aruba Central API.

    Posted Jul 08, 2024 05:46 PM

    Hi,

    I hope you are well.

    I have been testing with the example you provided, and it was successful. Thank you very much for your help.

    Now, I have a question: With that body, will I be able to send a notification to the user?

    Regards,




  • 5.  RE: I can't create a guest user through the Aruba Central API.

    Posted Jul 09, 2024 04:52 AM

    My guess would be that if you add in your JSON:

      "notify": true,
      "notify_to": "email",

    that there will be an e-mail notification. But haven't tried.



    ------------------------------
    Herman Robers
    ------------------------
    If you have urgent issues, always contact your Aruba partner, distributor, or Aruba TAC Support. Check https://www.arubanetworks.com/support-services/contact-support/ for how to contact Aruba TAC. Any opinions expressed here are solely my own and not necessarily that of Hewlett Packard Enterprise or Aruba Networks.

    In case your problem is solved, please invest the time to post a follow-up with the information on how you solved it. Others can benefit from that.
    ------------------------------



  • 6.  RE: I can't create a guest user through the Aruba Central API.

    Posted Jul 09, 2024 11:49 AM

    I added the parameters you sent me and managed to get the notification. I had tried the same way before, but I think I was adding an extra comma to the body.

    Thank you very much for your help.

    Best regards.




  • 7.  RE: I can't create a guest user through the Aruba Central API.

    Posted Aug 02, 2024 01:17 PM

    Hi, good morning.

    I have successfully automated the process for users to generate a request and receive credentials to access the guest network. However, I have a question: users cannot resubmit the request because it shows an error indicating that the username already exists in Aruba Central.

    Is it possible to configure Aruba Central to automatically delete guest accounts once they expire?

    Best regards,




  • 8.  RE: I can't create a guest user through the Aruba Central API.

    Posted Aug 05, 2024 06:11 AM

    Not sure, but can't you delete the account through API when you get that error and try again? Or test before if the account already exists, then delete it, before creating a new account? Or update the account when it already exists?



    ------------------------------
    Herman Robers
    ------------------------
    If you have urgent issues, always contact your Aruba partner, distributor, or Aruba TAC Support. Check https://www.arubanetworks.com/support-services/contact-support/ for how to contact Aruba TAC. Any opinions expressed here are solely my own and not necessarily that of Hewlett Packard Enterprise or Aruba Networks.

    In case your problem is solved, please invest the time to post a follow-up with the information on how you solved it. Others can benefit from that.
    ------------------------------



  • 9.  RE: I can't create a guest user through the Aruba Central API.

    Posted Aug 05, 2024 04:14 PM

    Currently, I can delete and update data through the API. I am exploring another option to retrieve all accounts with a GET request, detect which ones are expired, and based on that, make the appropriate request: a PUT if the account is expired or a POST if a new account needs to be created.