---
title: "(PKCE) Authorization code"
description: "In order to request the user to grant the access, you need to call Authorize. Browser window will be opened and user will be prompted for user name, password and grant the access of your application. Proper (same like you are using in your request) redirect uri needs to be configured in your accounts api settings."
---

> Documentation Index
> Fetch the complete documentation index at: /api-docs/llms.txt
> Use this file to discover all available pages before exploring further.

# (PKCE) Authorization code

<div class="endpoint-signature"><span data-method="GET">GET</span><code>/oauth/authorize</code></div>

In order to request the user to grant the access, you need to call Authorize. Browser window will be opened and user will be prompted for user name, password and grant the access of your application. Proper (same like you are using in your request) redirect uri needs to be configured in your accounts api settings.

## Query parameters

| Name | Example | Description |
|---|---|---|
| `client_id` | demo_identifier | — |
| `redirect_uri` | demo_identifier | — |
| `response_type` | code | — |
| `scope` | public | — |
| `code_challenge` | demo_identifier | — |
| `code_challenge_method` | S256 | — |

## Code examples

### cURL

```curl
curl --request GET 'https://app.datamolino.com/oauth/authorize?client_id=demo_identifier&redirect_uri=demo_identifier&response_type=code&scope=public&code_challenge=demo_identifier&code_challenge_method=S256'
```
### HTTP

```http
GET /oauth/authorize?client_id=demo_identifier&redirect_uri=demo_identifier&response_type=code&scope=public&code_challenge=demo_identifier&code_challenge_method=S256 HTTP/1.1
Host: app.datamolino.com
```
### JavaScript Fetch

```javascript
const response = await fetch("https://app.datamolino.com/oauth/authorize?client_id=demo_identifier&redirect_uri=demo_identifier&response_type=code&scope=public&code_challenge=demo_identifier&code_challenge_method=S256", {
  method: "GET",
  headers: {},
});

const data = await response.json();
```
### Node.js Axios

```javascript
import axios from "axios";

const response = await axios({
  method: "get",
  url: "https://app.datamolino.com/oauth/authorize?client_id=demo_identifier&redirect_uri=demo_identifier&response_type=code&scope=public&code_challenge=demo_identifier&code_challenge_method=S256",
  headers: {}
});

console.log(response.data);
```
### Python Requests

```python
import requests

url = "https://app.datamolino.com/oauth/authorize?client_id=demo_identifier&redirect_uri=demo_identifier&response_type=code&scope=public&code_challenge=demo_identifier&code_challenge_method=S256"
headers = {}

response = requests.request("GET", url, headers=headers)
response.raise_for_status()
print(response.json())
```
### Ruby Net::HTTP

```ruby
require 'json'
require 'net/http'

uri = URI("https://app.datamolino.com/oauth/authorize?client_id=demo_identifier&redirect_uri=demo_identifier&response_type=code&scope=public&code_challenge=demo_identifier&code_challenge_method=S256")
request = Net::HTTP::Get.new(uri)

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

puts JSON.parse(response.body)
```
### Ruby on Rails

```ruby
# app/services/datamolino_client.rb
require 'json'
require 'net/http'

class DatamolinoClient
  BASE_URL = "https://app.datamolino.com"

  def initialize(access_token: Rails.application.credentials.dig(:datamolino, :access_token))
@access_token = access_token
  end

  def request_pkce_authorization_code
uri = URI("#{BASE_URL}/oauth/authorize?client_id=demo_identifier&redirect_uri=demo_identifier&response_type=code&scope=public&code_challenge=demo_identifier&code_challenge_method=S256")
request = Net::HTTP::Get.new(uri)

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
  http.request(request)
end

JSON.parse(response.body)
  end
end
```
### PHP Guzzle

```php
<?php

use GuzzleHttp\Client;

$client = new Client();
$response = $client->request('GET', 'https://app.datamolino.com/oauth/authorize?client_id=demo_identifier&redirect_uri=demo_identifier&response_type=code&scope=public&code_challenge=demo_identifier&code_challenge_method=S256', [
'headers' => json_decode('{}', true)
]);

echo $response->getBody();
```
### Java OkHttp

```java
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
.url("https://app.datamolino.com/oauth/authorize?client_id=demo_identifier&redirect_uri=demo_identifier&response_type=code&scope=public&code_challenge=demo_identifier&code_challenge_method=S256")
.method("GET", null)
.build();

Response response = client.newCall(request).execute();
```
### C# HttpClient

```csharp
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Get, "https://app.datamolino.com/oauth/authorize?client_id=demo_identifier&redirect_uri=demo_identifier&response_type=code&scope=public&code_challenge=demo_identifier&code_challenge_method=S256");

using var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
```
### Go Native

```go
client := &http.Client{}
req, err := http.NewRequest("GET", "https://app.datamolino.com/oauth/authorize?client_id=demo_identifier&redirect_uri=demo_identifier&response_type=code&scope=public&code_challenge=demo_identifier&code_challenge_method=S256", nil)
if err != nil { panic(err) }

res, err := client.Do(req)
if err != nil { panic(err) }
defer res.Body.Close()

body, err := io.ReadAll(res.Body)
if err != nil { panic(err) }
fmt.Println(string(body))
```
### Swift URLSession

```swift
import Foundation

var request = URLRequest(url: URL(string: "https://app.datamolino.com/oauth/authorize?client_id=demo_identifier&redirect_uri=demo_identifier&response_type=code&scope=public&code_challenge=demo_identifier&code_challenge_method=S256")!)
request.httpMethod = "GET"

let (data, _) = try await URLSession.shared.data(for: request)
print(String(data: data, encoding: .utf8)!)
```

## Responses

### Response (PKCE) Authorization code

```text

```

Source: /api-docs/reference/authorization/pkce-authorization-code/index.md
