Class: Api::V1::Platform::AccessTokensController

Inherits:
ApplicationController
  • Object
show all
Includes:
StrongParameters
Defined in:
app/controllers/api/v1/platform/access_tokens_controller.rb

Defined Under Namespace

Modules: StrongParameters

Instance Method Summary collapse

Methods included from StrongParameters

#access_token_params

Instance Method Details

#createObject

POST /api/v1/platform/applications/:application_id/access_tokens



9
10
11
12
13
14
15
16
17
# File 'app/controllers/api/v1/platform/access_tokens_controller.rb', line 9

def create
  @access_token.provisioned = true

  if @access_token.save
    render :show, status: :created, location: [:api, :v1, @access_token]
  else
    render json: @access_token.errors, status: :unprocessable_entity
  end
end

#destroyObject

DELETE /api/v1/platform/access_tokens/:id



29
30
31
# File 'app/controllers/api/v1/platform/access_tokens_controller.rb', line 29

def destroy
  @access_token.destroy
end

#showObject

GET /api/v1/platform/access_tokens/:id



5
6
# File 'app/controllers/api/v1/platform/access_tokens_controller.rb', line 5

def show
end

#updateObject

PATCH/PUT /api/v1/platform/access_tokens/:id



20
21
22
23
24
25
26
# File 'app/controllers/api/v1/platform/access_tokens_controller.rb', line 20

def update
  if @access_token.update(access_token_params)
    render :show
  else
    render json: @access_token.errors, status: :unprocessable_entity
  end
end