oauthAuthorizeGet
OAuth2 authorization endpoint
Redirect users here to begin the OAuth2 authorization flow
/oauth/authorize
Usage and SDK Samples
curl -X GET\
-H "Accept: application/json"\
"https://api.example.com/v1/oauth/authorize?response_type=&client_id=&redirect_uri=&scope=&state="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.OAuth2Api;
import java.io.File;
import java.util.*;
public class OAuth2ApiExample {
public static void main(String[] args) {
OAuth2Api apiInstance = new OAuth2Api();
String responseType = responseType_example; // String | Must be 'code' for authorization code flow
String clientId = clientId_example; // String | The client ID obtained during registration
String redirectUri = redirectUri_example; // String | Must match one of the registered redirect URIs
String scope = scope_example; // String | Space-separated list of scopes (e.g., 'transactions:read transactions:write')
String state = state_example; // String | Optional state parameter to prevent CSRF attacks
try {
apiInstance.oauthAuthorizeGet(responseType, clientId, redirectUri, scope, state);
} catch (ApiException e) {
System.err.println("Exception when calling OAuth2Api#oauthAuthorizeGet");
e.printStackTrace();
}
}
}
import io.swagger.client.api.OAuth2Api;
public class OAuth2ApiExample {
public static void main(String[] args) {
OAuth2Api apiInstance = new OAuth2Api();
String responseType = responseType_example; // String | Must be 'code' for authorization code flow
String clientId = clientId_example; // String | The client ID obtained during registration
String redirectUri = redirectUri_example; // String | Must match one of the registered redirect URIs
String scope = scope_example; // String | Space-separated list of scopes (e.g., 'transactions:read transactions:write')
String state = state_example; // String | Optional state parameter to prevent CSRF attacks
try {
apiInstance.oauthAuthorizeGet(responseType, clientId, redirectUri, scope, state);
} catch (ApiException e) {
System.err.println("Exception when calling OAuth2Api#oauthAuthorizeGet");
e.printStackTrace();
}
}
}
String *responseType = responseType_example; // Must be 'code' for authorization code flow
String *clientId = clientId_example; // The client ID obtained during registration
String *redirectUri = redirectUri_example; // Must match one of the registered redirect URIs
String *scope = scope_example; // Space-separated list of scopes (e.g., 'transactions:read transactions:write') (optional)
String *state = state_example; // Optional state parameter to prevent CSRF attacks (optional)
OAuth2Api *apiInstance = [[OAuth2Api alloc] init];
// OAuth2 authorization endpoint
[apiInstance oauthAuthorizeGetWith:responseType
clientId:clientId
redirectUri:redirectUri
scope:scope
state:state
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error: %@", error);
}
}];
var OAuth2TransactionApi = require('o_auth2_transaction_api');
var api = new OAuth2TransactionApi.OAuth2Api()
var responseType = responseType_example; // {{String}} Must be 'code' for authorization code flow
var clientId = clientId_example; // {{String}} The client ID obtained during registration
var redirectUri = redirectUri_example; // {{String}} Must match one of the registered redirect URIs
var opts = {
'scope': scope_example, // {{String}} Space-separated list of scopes (e.g., 'transactions:read transactions:write')
'state': state_example // {{String}} Optional state parameter to prevent CSRF attacks
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
api.oauthAuthorizeGet(responseType, clientId, redirectUri, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class oauthAuthorizeGetExample
{
public void main()
{
var apiInstance = new OAuth2Api();
var responseType = responseType_example; // String | Must be 'code' for authorization code flow
var clientId = clientId_example; // String | The client ID obtained during registration
var redirectUri = redirectUri_example; // String | Must match one of the registered redirect URIs
var scope = scope_example; // String | Space-separated list of scopes (e.g., 'transactions:read transactions:write') (optional)
var state = state_example; // String | Optional state parameter to prevent CSRF attacks (optional)
try
{
// OAuth2 authorization endpoint
apiInstance.oauthAuthorizeGet(responseType, clientId, redirectUri, scope, state);
}
catch (Exception e)
{
Debug.Print("Exception when calling OAuth2Api.oauthAuthorizeGet: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\ApiOAuth2Api();
$responseType = responseType_example; // String | Must be 'code' for authorization code flow
$clientId = clientId_example; // String | The client ID obtained during registration
$redirectUri = redirectUri_example; // String | Must match one of the registered redirect URIs
$scope = scope_example; // String | Space-separated list of scopes (e.g., 'transactions:read transactions:write')
$state = state_example; // String | Optional state parameter to prevent CSRF attacks
try {
$api_instance->oauthAuthorizeGet($responseType, $clientId, $redirectUri, $scope, $state);
} catch (Exception $e) {
echo 'Exception when calling OAuth2Api->oauthAuthorizeGet: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::OAuth2Api;
my $api_instance = WWW::SwaggerClient::OAuth2Api->new();
my $responseType = responseType_example; # String | Must be 'code' for authorization code flow
my $clientId = clientId_example; # String | The client ID obtained during registration
my $redirectUri = redirectUri_example; # String | Must match one of the registered redirect URIs
my $scope = scope_example; # String | Space-separated list of scopes (e.g., 'transactions:read transactions:write')
my $state = state_example; # String | Optional state parameter to prevent CSRF attacks
eval {
$api_instance->oauthAuthorizeGet(responseType => $responseType, clientId => $clientId, redirectUri => $redirectUri, scope => $scope, state => $state);
};
if ($@) {
warn "Exception when calling OAuth2Api->oauthAuthorizeGet: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_client.OAuth2Api()
responseType = responseType_example # String | Must be 'code' for authorization code flow
clientId = clientId_example # String | The client ID obtained during registration
redirectUri = redirectUri_example # String | Must match one of the registered redirect URIs
scope = scope_example # String | Space-separated list of scopes (e.g., 'transactions:read transactions:write') (optional)
state = state_example # String | Optional state parameter to prevent CSRF attacks (optional)
try:
# OAuth2 authorization endpoint
api_instance.oauth_authorize_get(responseType, clientId, redirectUri, scope=scope, state=state)
except ApiException as e:
print("Exception when calling OAuth2Api->oauthAuthorizeGet: %s\n" % e)
Parameters
| Name | Description |
|---|---|
| response_type* |
String
Must be 'code' for authorization code flow
Required
|
| client_id* |
String
The client ID obtained during registration
Required
|
| redirect_uri* |
String
(uri)
Must match one of the registered redirect URIs
Required
|
| scope |
String
Space-separated list of scopes (e.g., 'transactions:read transactions:write')
|
| state |
String
Optional state parameter to prevent CSRF attacks
|
Responses
Status: 302 - Redirect to login page or back to client with authorization code
| Name | Type | Format | Description |
|---|---|---|---|
| Location | String | uri |