Renew, Update, or Delete Multiple Automated Device Enrollment Tokens

By Corey Willis

How to Renew and Update Multiple Automated Device Enrollment (ADE) Tokens using the Kandji API and Postman

If you need to add Automated Device Enrollment Tokens, please visit the Configure Multiple Automated Device Enrollment Tokens article.
If you do not feel confident in completing this process yourself, please reach out to Kandji Support for additional guidance.

Configure Kandji API Token

Prepare API Token and store it in a secure location. You can read more about this in our Kandji API article. You can skip this section if you already have an API Token prepared.

  1. Create or modify an existing API Token.
  2. In your Kandji tenant, navigate to Settings > Access > API Tokens.
  3. Create or modify the existing API Token to include all Automated Device Enrollment-related permissions.

Prepare Postman

For basic configuration, please follow our How to Set Up the Kandji API in Postman article. Most of the steps moving forward will be performed inside the Postman application on your device. You can skip this section if you already have Postman configured.

  1. Check your Collection for the Automated Device Enrollment integrations folder.
  2. If this folder is missing, go to api-docs.kandji.io, click the Run in Postman button, and follow the steps to import the new API version.
  3. Define your API URL if undefined in the Kandji API folder at the top of the collection.
  4. Define the API Token in your Environment variables following our How to Set Up the Kandji API in Postman article.

Configure Postman Environment Variables

Now that the basics of Postman have been configured, you will need to define some Environment Variables in Postman to keep track of the Automated Device Enrollment servers.

  1. Follow the instructions in the Create Environment Variables section of our How to Set Up the Kandji API in Postman article.
  2. If you already have environment variables configured, you can add the new items to the existing variables.
  3. Select the Kandji API > Automated Device Enrollment Integrations > GET List ADE Integrations in the Collection.
  4. Click the Send button.
  5. In the Body section of the Results, you will copy the top-level IDs of each Automated Device Enrollment token.
  6. For each of these IDs, you will create an environment variable with a naming scheme such as "ade_token_1" and increment the number at the end for each token.
  7. Make a note of the associated server_name for each token. You will need this information when downloading the tokens from Apple Business Manager.
  8. Paste the ID value for each token into the value for the machine "ade_token_#" variable.
  9. You can set the variable type to secret so that the value of the variable is not visible.

Download ADE Tokens

  1. Log in to your Apple Business Manager account.
  2. Click on your profile in the bottom left and choose Preferences.
  3. Click on the first MDM server that matches the first ADE token from the list you made earlier.
  4. Click download token.
  5. Repeat this process for each token that you will be renewing.

Create Postman Folder Template

Creating folders in Postman will make it easier to keep track of your Automated Device Enrollment tokens.

  1. Click on the ellipse next to the Automated Device Enrollment Integrations folder.
  2. Click Add folder.
  3. Name the folder ADE_Token1.
  4. Select the Renew ADE Integration and Update ADE Integration items in the Automated Device Enrollment Integrations folder.
  5. Right-click them and choose Copy.
  6. Click on the ellipse next to the ADE_Token1 folder.
  7. Click Paste.

Modify Renew Item

  1. Select the Renew ADE Integration item.
  2. Rename it to Renew ADE1 Integration.
  3. In the section to the right, click on address bar to the left of the Send button.
  4. Select the text inside the {{ade_token_ade}} and update it to {{ade_token_1}}.
  5. Click on the Body tab below.
  6. Enter the blueprint_id, phone, and email that should be associated with the token.
  7. For the file, click x by any current files, and then click Select Files.
  8. Choose the .p7m file that matches this ADE token.
  9. Save the changes.

Modify Update Item

  1. Select the Update ADE Integration item.
  2. Rename it to Update ADE1 Integration.
  3. In the section to the right, click on the address bar to the left of the Send button.
  4. Select the text inside the {{ade_token_ade}} and update it to {{ade_token_1}}.
  5. Click on the Body tab below.
  6. This is where you can enter new blueprint_id, phone, and email information.
  7. Save the changes.

Duplicate ADE_Token Folder

  1. Click on the ellipse next to the ADE_Token1 folder.
  2. Choose Duplicate.
  3. Update the contents of the folder using the process above.
  4. Make duplicates of the folder for each of your ADE tokens.

Renew ADE Integration

Now that everything is configured, you can send the Renew command.

  1. Select the Kandji API > Automated Device Enrollment Integrations > ADE_Token# > Renew ADE# Integration
  2. Click the Send button.

Update ADE Integration

Now that everything is configured, you can send the Renew command.

  1. Select the Kandji API > Automated Device Enrollment Integrations > ADE_Token# > Update ADE# Integration.
  2. Update the details in the Body section that need updating.
  3. Click the Send button.

Check Current Integrations

Kandji API > Automated Device Enrollment Integrations > GET List ADE Integrations command will give us all current ADE integrations so that we can verify that the integration was Renewed or Updated successfully.

  1. Select Kandji API > Automated Device Enrollment Integrations > GET List ADE Integrations in the Collection.
  2. Click the Send button.
  3. The days_left variable should be 364 if the Renew command was successful.
  4. To verify an update, check the information associated with the ADE token to verify that it was updated.

Delete Integration

Kandji API > Automated Device Enrollment Integrations > DEL Delete ADE Integration command will delete the ADE integration associated with the supplied ADE Token ID.

  • Select Kandji API > Automated Device Enrollment Integrations > DEL Delete ADE Integration in the Collection.
  • Populate the ade_token_id variable with the ID of the ADE Token.
  • Click the Send button.