Creating Bootstraps and Tokens with a Script
Creating Bootstraps and Tokens with a Script

Creating Bootstraps and Tokens with a Script

Use the Swagger APIs, accessible via the Provisioning Manager Portal, to generate a cURL command for adding a bootstrap or token. Insert the cURL command into a script that processes the bootstraps/tokens that need to be added to the Provisioning Manager.
The script must first authenticate with the Provisioning Manager by using
/admin/api/v1/auth/admin
with the body
{"username":"myUserName", "password":"myPassword"}
. Upon successful authentication, the Provisioning Manager returns an accessToken and tokenType (“Bearer”). These are combined into a string
Bearer <accessToken>
and sent as the authorization header shown in the cURL examples.

Example of a cURL command to add a bootstrap called “myBootstrap"

curl -X POST https:// <PVM URL>/admin/api/v1/bootstrap?name=myBootstrap -H "accept: */*" -H "authorization: Bearer <myAccessToken>" -H "Content-Type: application/json" -d "{\"site\":\"site-1094\"}"

Example of a cURL command to add a token called “myToken” using the “myBootstrap"

curl -X POST https:// <PVM URL>/admin/api/v1/token?appId=WFC_PRO_ANDROID &bootstrap=myBootstrap&description=<optional-description> &name=myToken -H "accept: */*" -H "authorization: Bearer <myAccessToken>"