A GET endpoint that retrieves specific guest user details within an organization using their email address while supporting multiple programming languages and optional query parameters for additional data inclusion.
Delete guest
DELETE /organizations/{org_id}/guests/{guest_email}
This endpoint removes a guest user record from the organization, identified by their email address. This action likely prevents the guest from accessing any further tasks or information within this organization.
Replace {org_id}
with your Organization ID and {guest_email}
with the URL-encoded email address of the guest to remove.
Authorization: Bearer {your_access_token}
Accept: application/json
X-Tallyfy-Client: APIClient
No request body is needed for this DELETE request.
const accessToken = 'YOUR_PERSONAL_ACCESS_TOKEN';const orgId = 'YOUR_ORGANIZATION_ID';const guestEmail = "guest.to.delete@example.com";const encodedEmail = encodeURIComponent(guestEmail); // Ensure email is URL encodedconst apiUrl = `https://go.tallyfy.com/api/organizations/${orgId}/guests/${encodedEmail}`;
const headers = new Headers();headers.append('Authorization', `Bearer ${accessToken}`);headers.append('Accept', 'application/json');headers.append('X-Tallyfy-Client', 'APIClient');
fetch(apiUrl, { method: 'DELETE', headers: headers}).then(response => { // Check for successful status codes (200, 201, 204) if (response.status === 200 || response.status === 201 || response.status === 204) { console.log(`Successfully deleted guest ${guestEmail}. Status: ${response.status}`); // Attempt to parse JSON only if not 204 if (response.status !== 204) { return response.json().catch(e => { console.warn("Could not parse JSON response for success status:", e); return null; // Continue successfully but without data }); } return null; // For 204 No Content } else { // Try to parse error JSON, fallback to text return response.json() .catch(() => response.text()) // If JSON parse fails .then(errData => { console.error(`Failed to delete guest ${guestEmail}. Status: ${response.status}`, errData); throw new Error(`HTTP error! status: ${response.status}`); }); }}).then(data => { if (data) { // Only log if data was parsed (i.e., status 200 or 201 with body) console.log('Deleted guest details (if returned):'); console.log(JSON.stringify(data, null, 2)); }}).catch(error => { console.error(`Error during deletion of guest ${guestEmail}:`, error.message);});
import requestsimport jsonimport osfrom urllib.parse import quote
access_token = os.environ.get('TALLYFY_ACCESS_TOKEN', 'YOUR_PERSONAL_ACCESS_TOKEN')org_id = os.environ.get('TALLYFY_ORG_ID', 'YOUR_ORGANIZATION_ID')guest_email = "guest.to.delete@example.com"encoded_email = quote(guest_email) # URL-encode the emailapi_url = f'https://go.tallyfy.com/api/organizations/{org_id}/guests/{encoded_email}'
headers = { 'Authorization': f'Bearer {access_token}', 'Accept': 'application/json', 'X-Tallyfy-Client': 'APIClient'}
response = Nonetry: response = requests.delete(api_url, headers=headers)
# Check for successful status codes if response.status_code in [200, 201]: print(f'Successfully deleted guest {guest_email}. Status: {response.status_code}') try: # Attempt to parse JSON if content exists if response.content: deleted_guest = response.json() print('Deleted guest details (if returned):') print(json.dumps(deleted_guest, indent=4)) else: print("(Response body empty)") except json.JSONDecodeError: print(f"(Received status {response.status_code} but body is not valid JSON: {response.text})") elif response.status_code == 204: print(f'Successfully deleted guest {guest_email}. Status: 204 No Content') else: # Raise an exception for other non-success status codes response.raise_for_status()
except requests.exceptions.HTTPError as http_err: print(f"HTTP error occurred deleting guest {guest_email}: {http_err}") if response is not None: print(f"Response Body: {response.text}")except requests.exceptions.RequestException as req_err: print(f"Request failed deleting guest {guest_email}: {req_err}")except Exception as err: print(f"An unexpected error occurred: {err}")
import java.net.URI;import java.net.URLEncoder;import java.net.http.HttpClient;import java.net.http.HttpRequest;import java.net.http.HttpResponse;import java.io.IOException;import java.nio.charset.StandardCharsets;
public class DeleteGuest { public static void main(String[] args) { String accessToken = System.getenv().getOrDefault("TALLYFY_ACCESS_TOKEN", "YOUR_PERSONAL_ACCESS_TOKEN"); String orgId = System.getenv().getOrDefault("TALLYFY_ORG_ID", "YOUR_ORGANIZATION_ID"); String guestEmail = "guest.to.delete@example.com"; String encodedEmail = URLEncoder.encode(guestEmail, StandardCharsets.UTF_8); String apiUrl = String.format("https://go.tallyfy.com/api/organizations/%s/guests/%s", orgId, encodedEmail);
HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(apiUrl)) .header("Authorization", "Bearer " + accessToken) .header("Accept", "application/json") .header("X-Tallyfy-Client", "APIClient") .DELETE() .build();
try { HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() == 200 || response.statusCode() == 201) { System.out.println("Successfully deleted guest " + guestEmail + ". Status: " + response.statusCode()); if (response.body() != null && !response.body().isEmpty()) { System.out.println("Response Body (Deleted Guest Details):"); System.out.println(response.body()); // TODO: Consider parsing JSON } else { System.out.println("(Response body empty)"); } } else if (response.statusCode() == 204) { System.out.println("Successfully deleted guest " + guestEmail + ". Status: 204 No Content"); } else { System.err.println("Failed to delete guest " + guestEmail + ". Status: " + response.statusCode()); System.err.println("Response Body: " + response.body()); } } catch (IOException | InterruptedException e) { System.err.println("Request failed: " + e.getMessage()); Thread.currentThread().interrupt(); } catch (Exception e) { System.err.println("An unexpected error occurred: " + e.getMessage()); e.printStackTrace(); } }}
package main
import ( "fmt" "io/ioutil" "net/http" "net/url" "os" "time")
func main() { accessToken := os.Getenv("TALLYFY_ACCESS_TOKEN") if accessToken == "" { accessToken = "YOUR_PERSONAL_ACCESS_TOKEN" } orgId := os.Getenv("TALLYFY_ORG_ID") if orgId == "" { orgId = "YOUR_ORGANIZATION_ID" } email := "guest.to.delete@example.com"
// URL-encode the email address encodedEmail := url.PathEscape(email) // Use PathEscape for path segments
apiUrl := fmt.Sprintf("https://go.tallyfy.com/api/organizations/%s/guests/%s", orgId, encodedEmail)
client := &http.Client{Timeout: 15 * time.Second} req, err := http.NewRequest(http.MethodDelete, apiUrl, nil) if err != nil { fmt.Printf("Error creating delete guest request for %s: %v\n", email, err) return }
req.Header.Set("Authorization", "Bearer "+accessToken) req.Header.Set("Accept", "application/json") req.Header.Set("X-Tallyfy-Client", "APIClient")
resp, err := client.Do(req) if err != nil { fmt.Printf("Error executing delete guest request for %s: %v\n", email, err) return } defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body) if err != nil { // Might occur for 204, check status first }
if resp.StatusCode == http.StatusOK || resp.StatusCode == http.StatusCreated { fmt.Printf("Successfully deleted guest %s. Status: %d\n", email, resp.StatusCode) if len(body) > 0 { fmt.Println("Response Body (Deleted Guest Details):") fmt.Println(string(body)) // TODO: Unmarshal JSON if needed } else { fmt.Println("(Response body empty)") } } else if resp.StatusCode == http.StatusNoContent { fmt.Printf("Successfully deleted guest %s. Status: %d No Content\n", email, resp.StatusCode) } else { fmt.Printf("Failed to delete guest %s. Status: %d\nBody: %s\n", email, resp.StatusCode, string(body)) }}
#include <iostream>#include <string>#include <urlmon.h> // For UrlEscape (Windows specific example)#include <windows.h> // Include before cpprest includes on Windows#include <cpprest/http_client.h>#include <cpprest/json.h>#pragma comment(lib, "urlmon.lib")
using namespace web;using namespace web::http;using namespace web::http::client;using namespace web::json;
// Helper function for basic URL encoding (consider a more robust library for production)utility::string_t UrlEncode(const utility::string_t& input) { // Using Windows UrlEscape - requires linking urlmon.lib // Consider cross-platform alternatives like cpp-netlib or manual implementation. DWORD size = 0; UrlEscape(input.c_str(), nullptr, &size, URL_ESCAPE_PERCENT); if (size == 0) return input; // Error or nothing to escape
std::vector<wchar_t> buffer(size); if (S_OK == UrlEscape(input.c_str(), buffer.data(), &size, URL_ESCAPE_PERCENT)) { return utility::string_t(buffer.data()); } else { // Handle error return input; }}
pplx::task<void> DeleteTallyfyGuest(const utility::string_t& guestEmail){ utility::string_t accessToken = U("YOUR_PERSONAL_ACCESS_TOKEN"); utility::string_t orgId = U("YOUR_ORGANIZATION_ID"); utility::string_t encodedEmail = UrlEncode(guestEmail); // URL Encode the email utility::string_t apiUrl = U("https://go.tallyfy.com/api/organizations/") + orgId + U("/guests/") + encodedEmail;
http_client client(apiUrl); http_request request(methods::DEL);
request.headers().add(U("Authorization"), U("Bearer ") + accessToken); request.headers().add(U("Accept"), U("application/json")); request.headers().add(U("X-Tallyfy-Client"), U("APIClient"));
return client.request(request).then([guestEmail](http_response response) { utility::string_t emailW = guestEmail; status_code status = response.status_code();
if (status == status_codes::OK || status == status_codes::Created) { return response.extract_json().then([emailW, status](pplx::task<value> task) { try { value const & body = task.get(); std::wcout << L"Successfully deleted guest " << emailW << L". Status: " << status << L"\nResponse Body:\n" << body.serialize() << std::endl; } catch (const http_exception& e) { std::wcout << L"Successfully deleted guest " << emailW << L". Status: " << status << L" (Body extraction failed: " << e.what() << L")." << std::endl; } }); } else if (status == status_codes::NoContent) { std::wcout << L"Successfully deleted guest " << emailW << L". Status: " << status << L" No Content." << std::endl; return pplx::task_from_result(); // Completed successfully } else { // Handle error return response.extract_string().then([status, emailW](utility::string_t errorBody) { std::wcerr << L"Failed to delete guest " << emailW << L". Status: " << status << std::endl; std::wcerr << L"Response Body: " << errorBody << std::endl; throw std::runtime_error("Failed to delete guest"); }); } });}
int main() { try { DeleteTallyfyGuest(U("guest.to.delete@example.com")).wait(); } catch (const std::exception &e) { std::cerr << "Error: " << e.what() << std::endl; } return 0;}// Requires C++ REST SDK (Casablanca). URL encoding example uses Windows API.
using System;using System.Net.Http;using System.Net.Http.Headers;using System.Threading.Tasks;using System.Text.Json;using System.Web; // For HttpUtility.UrlEncode
public class TallyfyGuestDeleter{ private static readonly HttpClient client = new HttpClient();
public static async Task DeleteGuestAsync(string guestEmail) { var accessToken = Environment.GetEnvironmentVariable("TALLYFY_ACCESS_TOKEN") ?? "YOUR_PERSONAL_ACCESS_TOKEN"; var orgId = Environment.GetEnvironmentVariable("TALLYFY_ORG_ID") ?? "YOUR_ORGANIZATION_ID"; var encodedEmail = HttpUtility.UrlEncode(guestEmail); // URL encode the email var apiUrl = $"https://go.tallyfy.com/api/organizations/{orgId}/guests/{encodedEmail}";
try { using var request = new HttpRequestMessage(HttpMethod.Delete, apiUrl); request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", accessToken); request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); request.Headers.Add("X-Tallyfy-Client", "APIClient");
HttpResponseMessage response = await client.SendAsync(request); string responseBody = await response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode) // Checks for 2xx (200, 201, 204) { Console.WriteLine($"Successfully deleted guest {guestEmail}. Status: {response.StatusCode}"); if (response.StatusCode != System.Net.HttpStatusCode.NoContent && !string.IsNullOrWhiteSpace(responseBody)) { Console.WriteLine("Deleted guest details (if returned):"); try { using var doc = JsonDocument.Parse(responseBody); Console.WriteLine(JsonSerializer.Serialize(doc.RootElement, new JsonSerializerOptions { WriteIndented = true })); } catch (JsonException) { Console.WriteLine(responseBody); } } } else { Console.WriteLine($"Failed to delete guest {guestEmail}. Status: {response.StatusCode}"); Console.WriteLine($"Response: {responseBody}"); } } catch (HttpRequestException e) { Console.WriteLine($"Request Exception deleting guest {guestEmail}: {e.Message}"); } catch (Exception ex) { Console.WriteLine($"An unexpected error occurred: {ex.Message}"); } }
// Example Usage: // static async Task Main(string[] args) // { // await DeleteGuestAsync("guest.to.delete@example.com"); // }}
A successful deletion might return 201 Created
, 200 OK
, or 204 No Content
.
- If
201
or200
, the body might contain the details of the deleted guest record. - If
204
, there is no response body.
If the guest email is not found, a 404 Not Found
error will be returned.
The POST endpoint creates guest users in an organization by accepting JSON data with required email and optional fields like name and company details while returning the newly created guest’s information upon success.
The PUT endpoint allows modification of existing guest user details through their email address with updated information like name phone and company details while maintaining the original email address.
The GET endpoint retrieves guest users from an organization with their details like email access history location information and optional statistics using various programming languages through authenticated API requests.
About Tallyfy
- 2025 Tallyfy, Inc.
- Privacy Policy
- Terms of Use
- Report Issue
- Trademarks