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



13
14
15
16
17
18
19
20
21
# File 'app/controllers/api/v1/platform/access_tokens_controller.rb', line 13

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



33
34
35
# File 'app/controllers/api/v1/platform/access_tokens_controller.rb', line 33

def destroy
  @access_token.destroy
end

#indexObject

GET /api/v1/platform/access_tokens



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

def index
end

#showObject

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



9
10
# File 'app/controllers/api/v1/platform/access_tokens_controller.rb', line 9

def show
end

#updateObject

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



24
25
26
27
28
29
30
# File 'app/controllers/api/v1/platform/access_tokens_controller.rb', line 24

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