Skip to content

Authorization code

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.

GET/oauth/authorize

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 —

Headers

Name Example Description
Content-Type application/json —

Code examples

curl --request GET 'https://app.datamolino.com/oauth/authorize?client_id=demo_identifier&redirect_uri=demo_identifier&response_type=code' \
  --header 'Content-Type: application/json'
GET /oauth/authorize?client_id=demo_identifier&redirect_uri=demo_identifier&response_type=code HTTP/1.1
Host: app.datamolino.com
Content-Type: application/json
const response = await fetch("https://app.datamolino.com/oauth/authorize?client_id=demo_identifier&redirect_uri=demo_identifier&response_type=code", {
  method: "GET",
  headers: {
    "Content-Type": "application/json"
  },
});

const data = await response.json();
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",
  headers: {
    "Content-Type": "application/json"
  }
});

console.log(response.data);
import requests

url = "https://app.datamolino.com/oauth/authorize?client_id=demo_identifier&redirect_uri=demo_identifier&response_type=code"
headers = {
  "Content-Type": "application/json"
}

response = requests.request("GET", url, headers=headers)
response.raise_for_status()
print(response.json())
require 'json'
require 'net/http'

uri = URI("https://app.datamolino.com/oauth/authorize?client_id=demo_identifier&redirect_uri=demo_identifier&response_type=code")
request = Net::HTTP::Get.new(uri)
request["Content-Type"] = "application/json"

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

puts JSON.parse(response.body)
# 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_authorization_code
    uri = URI("#{BASE_URL}/oauth/authorize?client_id=demo_identifier&redirect_uri=demo_identifier&response_type=code")
    request = Net::HTTP::Get.new(uri)
    request["Content-Type"] = "application/json"

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

    JSON.parse(response.body)
  end
end
<?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', [
    'headers' => json_decode('{"Content-Type":"application/json"}', true)
]);

echo $response->getBody();
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")
    .addHeader("Content-Type", "application/json")
    .method("GET", null)
    .build();

Response response = client.newCall(request).execute();
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");

using var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
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", nil)
if err != nil { panic(err) }
req.Header.Add("Content-Type", "application/json")

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))
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")!)
request.httpMethod = "GET"
request.setValue("application/json", forHTTPHeaderField: "Content-Type")

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

Responses

200 OK

Content type: text/html; charset=utf-8

Html > Login Page
Navigation

Type to search…

↑↓ navigate ↵ select Esc close