Configuration
Configure the CLI or REST API to use an API Key to access resources in Bindplane.
Using your API Key with the CLI
You can set the API Key value in your configuration by using the bindplane profile command.e.g.
bindplane profile set default --api-key 4689832f-1725-4eeb-8f9d-3e78cb0155ecThis sets your "default" profile to use the API key you just received. You may also need to set your remote-url to the correct endpoint, for app.bindplane.com users:
bindplane profile set default --remote-url https://app.bindplane.comMake sure you are using the default profile
bindplane profile use defaultNow verify you can retrieve resources, say Source Types
bindplane get source-typesTo set named profiles run
bindplane profile set "onprem" --api-key "xxxx-xxxx-xxxx-xxxx-xxxxxx"To use custom remote URLs run
bindplane profile set "onprem" \
--remote-url "http://192.168.1.10:3001" \
--api-key "xxxx-xxxx-xxxx-xxxx-xxxxxx"Scoped API Keys
If your key value begins with bps_, it is a scoped API Key and needs one extra setting. Scoped keys can reach more than one project, so they cannot infer which project to act on. Set it with --project:
You can also append --project to any individual command to override the profile:
Configure a profile with a user and password
Using your API Key with the REST API
You can use your API with the REST API by setting the X-Bindplane-Api-Key header. An example using curl with Bindplane Cloud:
With a scoped API Key, one whose value begins with bps_, also send the project ID in the X-Bindplane-Account-ID header. A scoped key sent without that header is rejected with 401 Unauthorized.
Last updated
Was this helpful?