curl --request GET \
--url https://api.paywalls.ai/v1/user/connect \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.paywalls.ai/v1/user/connect"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.paywalls.ai/v1/user/connect', 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.paywalls.ai/v1/user/connect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.paywalls.ai/v1/user/connect"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.paywalls.ai/v1/user/connect")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paywalls.ai/v1/user/connect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"connected": true,
"connectedUser": {
"paywallKeyId": "paywall_123",
"userId": "user_456",
"externalUserId": "ext_user_789",
"createdAt": "2023-10-01T12:00:00Z"
},
"message": "User is connected to the paywall."
}Authorize user
Checks whether a user is currently connected (i.e., has authorized charging).
If not connected, a url field will be returned to redirect the user to the connection flow (e.g., a consent or wallet approval page).
curl --request GET \
--url https://api.paywalls.ai/v1/user/connect \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.paywalls.ai/v1/user/connect"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.paywalls.ai/v1/user/connect', 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.paywalls.ai/v1/user/connect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.paywalls.ai/v1/user/connect"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.paywalls.ai/v1/user/connect")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paywalls.ai/v1/user/connect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"connected": true,
"connectedUser": {
"paywallKeyId": "paywall_123",
"userId": "user_456",
"externalUserId": "ext_user_789",
"createdAt": "2023-10-01T12:00:00Z"
},
"message": "User is connected to the paywall."
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Optional user identifier provided by the developer.
Can be used instead of the user property in the request body to associate the API call with a specific end user.
Query Parameters
The unique identifier of the user to check connection status for.
Response
User is connected to the paywall.
- Option 1
- Option 2
Response structure when a user is connected and authorized to be charged via the paywall.
Boolean indicating that the user is connected and authorized.
Information about a user who has successfully connected to a paywall. Includes internal and external user identifiers and the associated paywall key.
Show child attributes
Show child attributes
Human-readable message confirming the connection status.
Was this page helpful?