diff --git a/website/source/docs/vagrant-cloud/api.html.md.erb b/website/source/docs/vagrant-cloud/api.html.md.erb index af733f02c..3558322b9 100644 --- a/website/source/docs/vagrant-cloud/api.html.md.erb +++ b/website/source/docs/vagrant-cloud/api.html.md.erb @@ -75,13 +75,12 @@ Some API endpoints require authentication to create new resources, update or del Clients can authenticate using an authentication token. The token can be passed to Vagrant Cloud one of two ways: -1. (Preferred) Set the `X-Atlas-Token` header to the value of the authentication token. +1. (Preferred) Set the `Authorization` header to `"Bearer "` and the value of the authentication token. 2. Pass the authentication token as an `access_token` URL parameter. Examples below will set the header, but feel free to use whichever method is easier for your implementation. --> The header name `X-Atlas-Token` is an artifact of Vagrant Cloud's previous project name, "Atlas". --> This header will be updated in the near future, but `X-Atlas-Token` will continue to be supported for now to ensure backwards-compatibility. +-> The `X-Atlas-Token` header is also supported for backwards-compatibility. ### Request and Response Format @@ -171,27 +170,27 @@ In order to create a usable box on Vagrant Cloud, perform the following steps: # Create a new box curl \ --header "Content-Type: application/json" \ - --header "X-Atlas-Token: $VAGRANT_CLOUD_TOKEN" \ + --header "Authorization: Bearer $VAGRANT_CLOUD_TOKEN" \ https://app.vagrantup.com/api/v1/boxes \ --data '{ "box": { "username": "myuser", "name": "test" } }' # Create a new version curl \ --header "Content-Type: application/json" \ - --header "X-Atlas-Token: $VAGRANT_CLOUD_TOKEN" \ + --header "Authorization: Bearer $VAGRANT_CLOUD_TOKEN" \ https://app.vagrantup.com/api/v1/box/myuser/test/versions \ --data '{ "version": { "version": "1.2.3" } }' # Create a new provider curl \ --header "Content-Type: application/json" \ - --header "X-Atlas-Token: $VAGRANT_CLOUD_TOKEN" \ + --header "Authorization: Bearer $VAGRANT_CLOUD_TOKEN" \ https://app.vagrantup.com/api/v1/box/myuser/test/version/1.2.3/providers \ --data '{ "provider": { "name": "virtualbox" } }' # Prepare the provider for upload/get an upload URL response=$(curl \ - --header "X-Atlas-Token: $VAGRANT_CLOUD_TOKEN" \ + --header "Authorization: Bearer $VAGRANT_CLOUD_TOKEN" \ https://app.vagrantup.com/api/v1/box/myuser/test/version/1.2.3/provider/virtualbox/upload) # Extract the upload URL from the response (requires the jq command) @@ -202,7 +201,7 @@ In order to create a usable box on Vagrant Cloud, perform the following steps: # Release the version curl \ - --header "X-Atlas-Token: $VAGRANT_CLOUD_TOKEN" \ + --header "Authorization: Bearer $VAGRANT_CLOUD_TOKEN" \ https://app.vagrantup.com/api/v1/box/myuser/test/version/1.2.3/release \ --request PUT ``` @@ -213,7 +212,7 @@ In order to create a usable box on Vagrant Cloud, perform the following steps: api = HTTP.persistent("https://app.vagrantup.com").headers( "Content-Type" => "application/json", - "X-Atlas-Token" => ENV['VAGRANT_CLOUD_TOKEN'] + "Authorization" => "Bearer #{ENV['VAGRANT_CLOUD_TOKEN']}" ) # Create a new box @@ -334,7 +333,7 @@ Responds [`200 OK`](#200-ok) if the authentication request was successful, other