This API request retrieves information about an agent based on their agent ID.
This mechanism can only be used to retrieve information about an agent who is part of the application holder's store.
GET / POST https://shopiro.ca/api/v1/{appid}/{pvk}/get/agent
The response is a JSON object containing the following fields if the request is successful:
curl -X GET 'https://shopiro.ca/api/v1/your_app_id/your_private_key/get/agent?aid=the_agent_id'
$appid = 'your_app_id';
$pvk = 'your_private_key';
$aid = 'the_agent_id';
$url = "https://shopiro.ca/api/v1/{$appid}/{$pvk}/get/agent?aid={$aid}";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
const appId = 'yourAppId';
const pvk = 'yourPrivateKey';
const aid = 'theAgentId';
const url = `https://shopiro.ca/api/v1/${appId}/${pvk}/get/agent?aid=${aid}`;
fetch(url)
.then(response => response.json())
.then(data => console.log(data))
.catch((error) => console.error('Error:', error));
import requests
app_id = 'your_app_id'
pvk = 'your_private_key'
aid = 'the_agent_id'
url = f'https://shopiro.ca/api/v1/{app_id}/{pvk}/get/agent?aid={aid}'
response = requests.get(url)
if response.status_code == 200:
data = response.json()
print(data)
else:
print(f"Request failed with status code {response.status_code}")
use reqwest;
use std::collections::HashMap;
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
let app_id = "your_app_id";
let pvk = "your_private_key";
let aid = "the_agent_id";
let url = format!("https://shopiro.ca/api/v1/{}/{}//get/agent?aid={}", app_id, pvk, aid);
let client = reqwest::Client::new();
let res = client.get(&url).send().await?;
if res.status().is_success() {
let response_body: HashMap<String, String> = res.json().await?;
println!("{:?}", response_body);
} else {
println!("Request failed with status code {}", res.status());
}
Ok(())
}
require 'net/http'
require 'uri'
require 'json'
app_id = 'your_app_id'
pvk = 'your_private_key'
aid = 'the_agent_id'
url = URI("https://shopiro.ca/api/v1/#{app_id}/#{pvk}/get/agent?aid=#{aid}")
response = Net::HTTP.get_response(url)
if response.is_a?(Net::HTTPSuccess)
data = JSON.parse(response.body)
puts data
else
puts "Request failed with status code #{response.code}"
end
using System;
using System.Net.Http;
using System.Threading.Tasks;
public class Program
{
private static readonly HttpClient client = new HttpClient();
public static async Task Main(string[] args)
{
var appId = "your_app_id";
var pvk = "your_private_key";
var aid = "the_agent_id";
var url = $"https://shopiro.ca/api/v1/{appId}/{pvk}/get/agent?aid={aid}";
HttpResponseMessage response = await client.GetAsync(url);
if (response.IsSuccessStatusCode)
{
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
else
{
Console.WriteLine($"Request failed with status code {response.StatusCode}");
}
}
}