Skip to main content
POST
/
api
/
v1
/
oauth2
/
token
Issue a new access token
curl --request POST \
  --url https://core.quidkey.com/api/v1/oauth2/token \
  --header 'Content-Type: application/json' \
  --data '
{
  "grant_type": "<string>",
  "client_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "client_secret": "<string>"
}
'
import requests

url = "https://core.quidkey.com/api/v1/oauth2/token"

payload = {
    "grant_type": "<string>",
    "client_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "client_secret": "<string>"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    grant_type: '<string>',
    client_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
    client_secret: '<string>'
  })
};

fetch('https://core.quidkey.com/api/v1/oauth2/token', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://core.quidkey.com/api/v1/oauth2/token",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'grant_type' => '<string>',
    'client_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
    'client_secret' => '<string>'
  ]),
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://core.quidkey.com/api/v1/oauth2/token"

	payload := strings.NewReader("{\n  \"grant_type\": \"<string>\",\n  \"client_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"client_secret\": \"<string>\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://core.quidkey.com/api/v1/oauth2/token")
  .header("Content-Type", "application/json")
  .body("{\n  \"grant_type\": \"<string>\",\n  \"client_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"client_secret\": \"<string>\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://core.quidkey.com/api/v1/oauth2/token")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"grant_type\": \"<string>\",\n  \"client_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"client_secret\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "data": {
    "access_token": "example_access_token_xyz789",
    "refresh_token": "example_refresh_token_abc123",
    "token_type": "Bearer",
    "expires_in": 900
  }
}
{
  "success": false,
  "error": {
    "message": "Invalid input provided"
  }
}
{
  "success": true,
  "error": {
    "code": "INVALID_INPUT",
    "message": "<string>"
  }
}

Body

application/json

Request token with given grant type - client_credentials, magic_code, google_id_token, or refresh_token

Request token with given grant type - client_credentials, magic_code, google_id_token, or refresh_token

grant_type
string
required
Allowed value: "client_credentials"
client_id
string<uuid>
required

The client ID of the partner or merchant

Example:

"547544c3-eeac-492e-8df9-5a52ca4e6bdf"

client_secret
string
required

The client secret of the partner or merchant

Example:

"b717adcac3f26e8034574021fa647cd7d4edd67b615046df387f6712c3601048"

Response

Success

success
boolean
required

Indicates if the request was successful

Example:

true

data
object
required