Get Message
GET https://api-sandbox.coinflow.cash/api/auth
Get the message for the user’s wallet to sign.
Reference: /api-reference/api-reference/authentication/get-message
Authentication
x-coinflow-auth-walletheader (required) — The web3 wallet of the end user - see /api-reference/api-reference/authentication/get-session-keyx-coinflow-auth-blockchainheader (required) — The blockchain associated with the end user - see /api-reference/api-reference/authentication/get-session-key
Response
200
Ok
message(string, required)transaction(string, optional)
Examples
Request
{}
Response
{
"message": "Please sign this message to authenticate your wallet for CoinFlow access.",
"transaction": "0x5f2b3a9c4d7e8f1234567890abcdef1234567890abcdef1234567890abcdef12"
}
SDK Code
import requests
url = "https://api-sandbox.coinflow.cash/api/auth"
payload = {}
headers = {
"x-coinflow-auth-wallet": "<apiKey>",
"Content-Type": "application/json"
}
response = requests.get(url, json=payload, headers=headers)
print(response.json())
const url = 'https://api-sandbox.coinflow.cash/api/auth';
const options = {
method: 'GET',
headers: {'x-coinflow-auth-wallet': '<apiKey>', 'Content-Type': 'application/json'},
body: '{}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.coinflow.cash/api/auth"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("GET", url, payload)
req.Header.Add("x-coinflow-auth-wallet", "<apiKey>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
url = URI("https://api-sandbox.coinflow.cash/api/auth")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-coinflow-auth-wallet"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse<String> response = Unirest.get("https://api-sandbox.coinflow.cash/api/auth")
.header("x-coinflow-auth-wallet", "<apiKey>")
.header("Content-Type", "application/json")
.body("{}")
.asString();
<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://api-sandbox.coinflow.cash/api/auth', [
'body' => '{}',
'headers' => [
'Content-Type' => 'application/json',
'x-coinflow-auth-wallet' => '<apiKey>',
],
]);
echo $response->getBody();
using RestSharp;
var client = new RestClient("https://api-sandbox.coinflow.cash/api/auth");
var request = new RestRequest(Method.GET);
request.AddHeader("x-coinflow-auth-wallet", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
import Foundation
let headers = [
"x-coinflow-auth-wallet": "<apiKey>",
"Content-Type": "application/json"
]
let parameters = [] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.coinflow.cash/api/auth")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()