Fetch Business Info
POST
https://api-v3.sweeppea.com/account/business
Description
This endpoint allows you to fetch business information from the user's profile. Use this to retrieve business-specific data programmatically through the Sweeppea API.
Code Examples
curl -X POST "https://api-v3.sweeppea.com/account/business" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"
const response = await fetch('https://api-v3.sweeppea.com/account/business', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
});
const data = await response.json();
console.log(data);
import requests
url = "https://api-v3.sweeppea.com/account/business"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
response = requests.post(url, headers=headers)
print(response.json())
Response
{
"Response": true,
"Data": {
"BusinessName": "string",
"BusinessTelephone": "string",
"BusinessAddress": "string",
"BusinessCity": "string",
"BusinessState": "string",
"BusinessZipCode": "string",
"BusinessCountry": "string",
"BusinessWebsite": "string",
"EIN": "string"
},
"Telemetry": {
"DataConsumed": 0,
"APICalls": 142,
"MaxAPICalls": 500000
}
}
Error Responses
{
"Response": false,
"Message": "Missing or invalid Bearer token. Send your API token in the Authorization header as: Authorization: Bearer YOUR_API_TOKEN",
"Code": 401
}
{
"Response": false,
"Message": "Invalid API token. It does not match any account.",
"Code": 403
}
{
"Response": false,
"Message": "User Profile Not Found",
"Code": 404
}