Skip to content

Get guest

Endpoint

GET /organizations/{org_id}/guests/{guest_email}

This endpoint retrieves the details for a specific guest user within the organization, identified by their email address.

Request

Replace {org_id} with your Organization ID and {guest_email} with the URL-encoded email address of the guest you want to retrieve (e.g., user%40example.com).

Headers

  • Authorization: Bearer {your_access_token}
  • Accept: application/json
  • X-Tallyfy-Client: APIClient

Query Parameters (Optional)

  • with (string): Include additional related data, e.g., stats.

Code Samples

const accessToken = 'YOUR_PERSONAL_ACCESS_TOKEN';
const orgId = 'YOUR_ORGANIZATION_ID';
const guestEmail = "guest.to.get@example.com";
const encodedEmail = encodeURIComponent(guestEmail);
const queryParams = '?with=stats'; // Example
const apiUrl = `https://go.tallyfy.com/api/organizations/${orgId}/guests/${encodedEmail}${queryParams}`;
const headers = new Headers();
headers.append('Authorization', `Bearer ${accessToken}`);
headers.append('Accept', 'application/json');
headers.append('X-Tallyfy-Client', 'APIClient');
fetch(apiUrl, {
method: 'GET',
headers: headers
})
.then(response => {
if (!response.ok) {
// Error handling...
return response.json().then(errData => { throw new Error(/*...*/); }).catch(() => { throw new Error(/*...*/); });
}
return response.json();
})
.then(data => {
console.log(`Successfully retrieved guest ${guestEmail}:`);
console.log(JSON.stringify(data, null, 2));
})
.catch(error => {
console.error(`Error getting guest ${guestEmail}:`, error);
});

Response

A successful request returns a 200 OK or 201 Created status code and a JSON object containing a data field with the guest’s details.

{
"data": {
"id": "guest_code_abc123",
"email": "guest.to.get@example.com",
"last_accessed_at": "2024-05-15T10:00:00Z",
"details": {
"first_name": "Specific",
"last_name": "Guest",
"status": "active",
"company_name": "Guest Company",
// ... other guest details ...
},
// Included if requested with 'with=stats'
"stats": { ... }
}
}

If the guest email is not found or you lack permission, you will likely receive a 404 Not Found or 403 Forbidden error.