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:



17
18
19
20
21
22
23
24
25
# File 'lib/mastodon/rest/apps.rb', line 17

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