Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Use the Django Web Interface to Make API Changes

The Juniper Mist API is built on a Django Representational State Transfer (REST) framework. This architecture allows for a browsable API. This API allows for increased usability and flexibility by enabling you and other users to perform CRUD operations within the API. In a sense, the Django interface acts like a RESTful client. This function is handy for executing CRUD operations on a single API object.

To make a change to a configuration object, you must be logged in to the Juniper Mist portal and know the URL API path of the object. Consult the API documentation, for details and parameters for changing objects. You will find the URL API paths for all objects available.

This task walks you through how to get device information from an access point (AP) and rename the AP directly from the Django interface.

To use the Django web interface to make API changes:

  1. Log in to the Juniper Mist portal.
  2. Open the API URL for a specific device: https://<api-endpoint>/api/v1/sites/<site_id>/devices?name=<device name>. The device name is case-sensitive.
    Note:

    Replace the placeholders with the correct API endpoint, site ID, and device name.

    In this case, the URL will look like this (portions of the site_id are omitted):

    https://{api-host}/api/v1/sites/c1947558-268d-4d31-xxxx-xxxxxxxxxxxx/devices?name=TEST-rename

    The browser issues the following command through the Django interface:

    Juniper Mist assigns every device a unique identifier, which is typically based on the MAC address (00000000-0000-0000-1000-<device_mac>). In the context of the device API, it is called id. You need to reference the AP using id so the API knows which specific device to rename.

  3. To make the change, insert the device ID (id) into the API call and display it in the browser.
    The new call will look like this:

    https://api.mist.com/api/v1/sites/c1947558-268d-4d31-xxxx-xxxxxxxxxxxx/devices/00000000-0000-0000-1000-5c5b3xxxxxxx

    The output is the same as the previous request; however, the API context now enables you to make a change to the specific device based on the id and not the name. Notice the lack of enclosing “[ ]” brackets.
  4. Enter the JavaScript Object Notation (JSON)-formatted text in the Content input box for the intended AP rename call. You do not need to include the unique device ID (id) because the id context exists in the URL.
  5. Once complete, press PUT to push the request to Juniper Mist. The results should look like this, indicating that the AP has been renamed:

    For more information, see the Site section of the API Documentation site.