User
This endpoint allows you to access user account information.
GET/api/v1/user/info/
Get information about the currently authenticated user
Example Request
- cURL
- JavaScript
- PHP
- Python
- Go
- C#
curl -X GET https://api.axro.com/api/v1/user/info/ \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
// Using Fetch API
fetch('https://api.axro.com/api/v1/user/info/', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
// Using cURL
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.axro.com/api/v1/user/info/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer YOUR_ACCESS_TOKEN'
));
$response = curl_exec($ch);
$error = curl_error($ch);
curl_close($ch);
if ($error) {
echo "Error: " . $error;
} else {
$data = json_decode($response, true);
print_r($data);
}
# Using requests library
import requests
url = 'https://api.axro.com/api/v1/user/info/'
headers = {'Authorization': 'Bearer YOUR_ACCESS_TOKEN'}
response = requests.get(url, headers=headers)
print(response.status_code)
print(response.json())
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.axro.com/api/v1/user/info/"
req, err := http.NewRequest("GET", url, nil)
if err != nil {
fmt.Println("Error creating request:", err)
return
}
req.Header.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error sending request:", err)
return
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Println("Error reading response:", err)
return
}
fmt.Println("Response Status:", resp.Status)
fmt.Println("Response Body:", string(body))
}
// Using HttpClient (modern approach)
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
using (HttpClient client = new HttpClient())
{
// Set authorization header
client.DefaultRequestHeaders.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN");
// Make the GET request
HttpResponseMessage response = await client.GetAsync("https://api.axro.com/api/v1/user/info/");
// Read the response
string responseBody = await response.Content.ReadAsStringAsync();
// Check if request was successful
if (response.IsSuccessStatusCode)
{
Console.WriteLine("Response: " + responseBody);
}
else
{
Console.WriteLine("Error: " + response.StatusCode);
Console.WriteLine("Response: " + responseBody);
}
}
}
}
Example Response
{
"email": "user@example.com",
"customer": {
"company": "Example Corp"
},
"billing_address": {
"company": "Example Corp",
"department": "Purchasing",
"street": "123 Main St",
"zip": "10001",
"city": "New York",
"country": "US"
}
}