curl --request POST \
--url https://api.manalens.dev/v0/link \
--header 'Content-Type: application/json' \
--header 'X-Publishable-Key: <api-key>' \
--data '
{
"provider": "steam",
"ticket": "140000000a0b0c0d0e0f101112131415",
"anonymous_id": "6a2f41a2-7d36-4c8e-9a54-2b1f9b0f0c11"
}
'import requests
url = "https://api.manalens.dev/v0/link"
payload = {
"provider": "steam",
"ticket": "140000000a0b0c0d0e0f101112131415",
"anonymous_id": "6a2f41a2-7d36-4c8e-9a54-2b1f9b0f0c11"
}
headers = {
"X-Publishable-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Publishable-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
provider: 'steam',
ticket: '140000000a0b0c0d0e0f101112131415',
anonymous_id: '6a2f41a2-7d36-4c8e-9a54-2b1f9b0f0c11'
})
};
fetch('https://api.manalens.dev/v0/link', 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://api.manalens.dev/v0/link",
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([
'provider' => 'steam',
'ticket' => '140000000a0b0c0d0e0f101112131415',
'anonymous_id' => '6a2f41a2-7d36-4c8e-9a54-2b1f9b0f0c11'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Publishable-Key: <api-key>"
],
]);
$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://api.manalens.dev/v0/link"
payload := strings.NewReader("{\n \"provider\": \"steam\",\n \"ticket\": \"140000000a0b0c0d0e0f101112131415\",\n \"anonymous_id\": \"6a2f41a2-7d36-4c8e-9a54-2b1f9b0f0c11\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Publishable-Key", "<api-key>")
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://api.manalens.dev/v0/link")
.header("X-Publishable-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"provider\": \"steam\",\n \"ticket\": \"140000000a0b0c0d0e0f101112131415\",\n \"anonymous_id\": \"6a2f41a2-7d36-4c8e-9a54-2b1f9b0f0c11\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.manalens.dev/v0/link")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Publishable-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"provider\": \"steam\",\n \"ticket\": \"140000000a0b0c0d0e0f101112131415\",\n \"anonymous_id\": \"6a2f41a2-7d36-4c8e-9a54-2b1f9b0f0c11\"\n}"
response = http.request(request)
puts response.read_body{
"linked": true,
"provider": "steam"
}{
"error": {
"code": "STEAM_TICKET_INVALID",
"message": "Steam did not accept this ticket. Get a new ticket for the identity \"manalens\" and try again."
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
],
"refused": [
{
"index": 0,
"message_id": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"results": [
{
"index": 0,
"user_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
}
}
],
"feature": "<string>",
"billing_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
],
"refused": [
{
"index": 0,
"message_id": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"results": [
{
"index": 0,
"user_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
}
}
],
"feature": "<string>",
"billing_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
],
"refused": [
{
"index": 0,
"message_id": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"results": [
{
"index": 0,
"user_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
}
}
],
"feature": "<string>",
"billing_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
],
"refused": [
{
"index": 0,
"message_id": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"results": [
{
"index": 0,
"user_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
}
}
],
"feature": "<string>",
"billing_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
],
"refused": [
{
"index": 0,
"message_id": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"results": [
{
"index": 0,
"user_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
}
}
],
"feature": "<string>",
"billing_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
],
"refused": [
{
"index": 0,
"message_id": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"results": [
{
"index": 0,
"user_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
}
}
],
"feature": "<string>",
"billing_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
],
"refused": [
{
"index": 0,
"message_id": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"results": [
{
"index": 0,
"user_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
}
}
],
"feature": "<string>",
"billing_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
],
"refused": [
{
"index": 0,
"message_id": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"results": [
{
"index": 0,
"user_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
}
}
],
"feature": "<string>",
"billing_url": "<string>"
}
}Link a Steam account
Link the Steam account that runs the game to the game install (anonymous_id) with a Steam ticket. The player does not sign in. Use the publishable key in X-Publishable-Key, or the secret key as Authorization: Bearer from a game server. With the publishable key, a web build must run on the project domain or an allowed origin. A game sends no Origin.
Manalens checks the ticket with Steam (ISteamUserAuth/AuthenticateUserTicket), with the project’s Steam Web API key, the project’s App ID and the fixed identity manalens. Then it reads which apps of the project the account owns (ISteamUser/GetPublisherAppOwnership): at the first link, and again when the last read is older than 15 days. When the ownership read fails, the link is still saved and the answer is 200. The response never contains the SteamID.
The checks run in this order: the body, the key, the Steam connection, the rate limits, then Steam. A request that fails a check before the rate limits does not count against them. Send it to the API host only: events.manalens.dev serves only POST /v0/events.
curl --request POST \
--url https://api.manalens.dev/v0/link \
--header 'Content-Type: application/json' \
--header 'X-Publishable-Key: <api-key>' \
--data '
{
"provider": "steam",
"ticket": "140000000a0b0c0d0e0f101112131415",
"anonymous_id": "6a2f41a2-7d36-4c8e-9a54-2b1f9b0f0c11"
}
'import requests
url = "https://api.manalens.dev/v0/link"
payload = {
"provider": "steam",
"ticket": "140000000a0b0c0d0e0f101112131415",
"anonymous_id": "6a2f41a2-7d36-4c8e-9a54-2b1f9b0f0c11"
}
headers = {
"X-Publishable-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Publishable-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
provider: 'steam',
ticket: '140000000a0b0c0d0e0f101112131415',
anonymous_id: '6a2f41a2-7d36-4c8e-9a54-2b1f9b0f0c11'
})
};
fetch('https://api.manalens.dev/v0/link', 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://api.manalens.dev/v0/link",
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([
'provider' => 'steam',
'ticket' => '140000000a0b0c0d0e0f101112131415',
'anonymous_id' => '6a2f41a2-7d36-4c8e-9a54-2b1f9b0f0c11'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Publishable-Key: <api-key>"
],
]);
$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://api.manalens.dev/v0/link"
payload := strings.NewReader("{\n \"provider\": \"steam\",\n \"ticket\": \"140000000a0b0c0d0e0f101112131415\",\n \"anonymous_id\": \"6a2f41a2-7d36-4c8e-9a54-2b1f9b0f0c11\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Publishable-Key", "<api-key>")
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://api.manalens.dev/v0/link")
.header("X-Publishable-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"provider\": \"steam\",\n \"ticket\": \"140000000a0b0c0d0e0f101112131415\",\n \"anonymous_id\": \"6a2f41a2-7d36-4c8e-9a54-2b1f9b0f0c11\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.manalens.dev/v0/link")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Publishable-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"provider\": \"steam\",\n \"ticket\": \"140000000a0b0c0d0e0f101112131415\",\n \"anonymous_id\": \"6a2f41a2-7d36-4c8e-9a54-2b1f9b0f0c11\"\n}"
response = http.request(request)
puts response.read_body{
"linked": true,
"provider": "steam"
}{
"error": {
"code": "STEAM_TICKET_INVALID",
"message": "Steam did not accept this ticket. Get a new ticket for the identity \"manalens\" and try again."
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
],
"refused": [
{
"index": 0,
"message_id": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"results": [
{
"index": 0,
"user_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
}
}
],
"feature": "<string>",
"billing_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
],
"refused": [
{
"index": 0,
"message_id": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"results": [
{
"index": 0,
"user_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
}
}
],
"feature": "<string>",
"billing_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
],
"refused": [
{
"index": 0,
"message_id": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"results": [
{
"index": 0,
"user_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
}
}
],
"feature": "<string>",
"billing_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
],
"refused": [
{
"index": 0,
"message_id": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"results": [
{
"index": 0,
"user_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
}
}
],
"feature": "<string>",
"billing_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
],
"refused": [
{
"index": 0,
"message_id": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"results": [
{
"index": 0,
"user_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
}
}
],
"feature": "<string>",
"billing_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
],
"refused": [
{
"index": 0,
"message_id": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"results": [
{
"index": 0,
"user_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
}
}
],
"feature": "<string>",
"billing_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
],
"refused": [
{
"index": 0,
"message_id": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"results": [
{
"index": 0,
"user_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
}
}
],
"feature": "<string>",
"billing_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
],
"refused": [
{
"index": 0,
"message_id": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"results": [
{
"index": 0,
"user_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
}
}
],
"feature": "<string>",
"billing_url": "<string>"
}
}Authorizations
Body
Fields that are not in this list are ignored.