Check API Key Status
curl --request POST \
--url https://sandbox.getmipay.com/api/action/check-api-key \
--header 'Content-Type: application/json' \
--data '
{
"secret_apikey": "gmp_sk_1234567890abcdef"
}
'import requests
url = "https://sandbox.getmipay.com/api/action/check-api-key"
payload = { "secret_apikey": "gmp_sk_1234567890abcdef" }
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({secret_apikey: 'gmp_sk_1234567890abcdef'})
};
fetch('https://sandbox.getmipay.com/api/action/check-api-key', 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://sandbox.getmipay.com/api/action/check-api-key",
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([
'secret_apikey' => 'gmp_sk_1234567890abcdef'
]),
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://sandbox.getmipay.com/api/action/check-api-key"
payload := strings.NewReader("{\n \"secret_apikey\": \"gmp_sk_1234567890abcdef\"\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://sandbox.getmipay.com/api/action/check-api-key")
.header("Content-Type", "application/json")
.body("{\n \"secret_apikey\": \"gmp_sk_1234567890abcdef\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.getmipay.com/api/action/check-api-key")
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 \"secret_apikey\": \"gmp_sk_1234567890abcdef\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"api_key": {
"id": 1,
"key": "pk_1234567890abcdef",
"status": "active",
"is_active": true,
"activated_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z",
"has_been_rotated": false,
"rotation_count": 0
},
"merchant": {
"id": 1,
"business_name": "My Business",
"kyc_status": "approved",
"kyc_status_label": "Approved",
"status": "active",
"is_active": true,
"can_transact": true
}
}
}{
"success": false,
"message": "Invalid KEY",
"error_code": "INVALID_PUBLIC_KEY"
}Auth
Check API Key Status
Public endpoint to check the status and validity of an API key without creating a JWT session.
POST
/
action
/
check-api-key
Check API Key Status
curl --request POST \
--url https://sandbox.getmipay.com/api/action/check-api-key \
--header 'Content-Type: application/json' \
--data '
{
"secret_apikey": "gmp_sk_1234567890abcdef"
}
'import requests
url = "https://sandbox.getmipay.com/api/action/check-api-key"
payload = { "secret_apikey": "gmp_sk_1234567890abcdef" }
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({secret_apikey: 'gmp_sk_1234567890abcdef'})
};
fetch('https://sandbox.getmipay.com/api/action/check-api-key', 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://sandbox.getmipay.com/api/action/check-api-key",
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([
'secret_apikey' => 'gmp_sk_1234567890abcdef'
]),
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://sandbox.getmipay.com/api/action/check-api-key"
payload := strings.NewReader("{\n \"secret_apikey\": \"gmp_sk_1234567890abcdef\"\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://sandbox.getmipay.com/api/action/check-api-key")
.header("Content-Type", "application/json")
.body("{\n \"secret_apikey\": \"gmp_sk_1234567890abcdef\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.getmipay.com/api/action/check-api-key")
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 \"secret_apikey\": \"gmp_sk_1234567890abcdef\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"api_key": {
"id": 1,
"key": "pk_1234567890abcdef",
"status": "active",
"is_active": true,
"activated_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z",
"has_been_rotated": false,
"rotation_count": 0
},
"merchant": {
"id": 1,
"business_name": "My Business",
"kyc_status": "approved",
"kyc_status_label": "Approved",
"status": "active",
"is_active": true,
"can_transact": true
}
}
}{
"success": false,
"message": "Invalid KEY",
"error_code": "INVALID_PUBLIC_KEY"
}⌘I
