Module: Mastodon::REST::Apps

Includes:
Utils
Included in:
API
Defined in:
lib/mastodon/rest/apps.rb

Instance Method Summary collapse

Methods included from Utils

#array_param, #perform_request, #perform_request_with_collection, #perform_request_with_object

Instance Method Details

#create_app(name, redirect_uri, scopes = 'read', website = nil) ⇒ Mastodon::App

Register a new OAuth client app on the target instance

Parameters:

  • name (String)
  • redirect_uri (String)
  • scopes (String) (defaults to: 'read')
  • website (String) (defaults to: nil)

Returns:



16
17
18
# File 'lib/mastodon/rest/apps.rb', line 16

def create_app(name, redirect_uri, scopes = 'read', website = nil)
  perform_request_with_object(:post, '/api/v1/apps', { client_name: name, redirect_uris: redirect_uri, scopes: scopes, website: website }, Mastodon::App)
end

#verify_app_credentialsMastodon::Entities::App

Return currently used app and confirm that client credentials are valid



22
23
24
# File 'lib/mastodon/rest/apps.rb', line 22

def verify_app_credentials
  perform_request_with_object(:get, '/api/v1/apps/verify_credentials', {}, Mastodon::Entities::App)
end