Developer

 View Only
  • 1.  New Central Config Assignment API keeps failing

    Posted Mar 05, 2026 12:58 PM

    Wondering if anyone has gotten this to work.

    I'm plugging in my values on the website directly which produces this

    curl --request POST \
         --url https://us1.api.central.arubanetworks.com/network-config/v1alpha1/config-assignments/86811126654554112/ACCESS_SWITCH/layer2-vlan/8 \
         --header 'accept: application/json' \
         --header 'authorization: Bearer {{token_goes_here}}' \
         --header 'content-type: application/json' \
         --data '
    {
      "device-function": "ACCESS_SWITCH",
      "profile-instance": "8",
      "profile-type": "layer2-vlan",
      "scope-id": "86811126654554112"
    }
    '

    I keep getting

    {
      "errorCode": "HPE_GL_ERROR_BAD_REQUEST",
      "httpStatusCode": 400,
      "message": "Invalid payload",
      "debugId": "480916939e90ef9b536291fd497b9700"
    }

    Here is the output for that vlan if i manually assign and GET the API

        {
          "scope-id": "86811126654554112",
          "device-function": "ACCESS_SWITCH",
          "profile-type": "layer2-vlan",
          "profile-instance": "8",
          "scope-name": "Site_Col",
          "scope-type": "SITE_COLLECTION"
        },



    -------------------------------------------


  • 2.  RE: New Central Config Assignment API keeps failing

    Posted Mar 05, 2026 03:47 PM

    It looks like the API referenced here functions however
    https://developer.arubanetworks.com/new-central/docs/working-with-library-profiles#assigning-with-central-api

    curl --request POST \
         --url https://{base_url}/network-config/v1alpha1/scope-maps \
         --header 'accept: application/json' \
         --header 'authorization: Bearer {{token}}' \
         --header 'content-type: application/json' \
         --data '
    {
      "scope-map": [
        {
          "scope-name": "1234567",
          "persona": "ACCESS_SWITCH",
          "resource": "layer2-vlan/404"
        }
      ]
    }
    '
    -------------------------------------------



  • 3.  RE: New Central Config Assignment API keeps failing
    Best Answer

    Posted Mar 06, 2026 03:08 AM
    Hi Eric,
     
    We're currently transitioning to a new endpoint for configuration assignment that's more user friendly. The documentation needs to be fixed to match the proper endpoint/payload, this will be done soon! The correct endpoint is the bulk path of  https://us1.api.central.arubanetworks.com/network-config/v1alpha1/config-assignments and the payload is similar to that of scope-maps with a nested dictionary containing a list of mappings. It looks like you are missing the "config-assignment" key/value pair in your payload which is causing your issue.
     
    Here is an example of a config-assignments payload that should work for you:
    curl --location 'https://us1.api.central.arubanetworks.com/network-config/v1alpha1/config-assignments' \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Bearer <token>' \
    --data '{ "config-assignment":
        [
            {
                "scope-id": "86811126654554112",
                "device-function": "ACCESS_SWITCH",
                "profile-type": "layer2-vlan",
                "profile-instance": "8"
            }
        ]
    }'
     
    Give this a shot and let me know if that worked!
    -------------------------------------------



  • 4.  RE: New Central Config Assignment API keeps failing

    Posted Mar 06, 2026 10:25 AM
    Edited by Eric Dresser Mar 06, 2026 10:25 AM

    Yep that works for me thanks!

    Here it is in Ansible

    - name: Create Config_Assignments
      ansible.builtin.uri:
        method: POST
        headers:
          Accept: application/json
          Content-Type: application/json
          Authorization: 'Bearer {{aruba_apikey.json.access_token}}'
        body_format: json
        body:
          config-assignment:
            - scope-id: '86811126654554112'
              device-function: ACCESS_SWITCH
              profile-type: layer2-vlan
              profile-instance: '8'
        validate_certs: no
        return_content: true

    -------------------------------------------