Get a list of all groups.
Get group
GET /organizations/{org_id}/groups/{group_id}
This endpoint retrieves the details for a single group identified by its unique ID.
Replace {org_id}
with your Organization ID and {group_id}
with the specific ID of the group you want to retrieve.
Authorization: Bearer {your_access_token}
Accept: application/json
X-Tallyfy-Client: APIClient
with
(string): Include additional related data, e.g.,assets
(for group logo).
const accessToken = 'YOUR_PERSONAL_ACCESS_TOKEN';const orgId = 'YOUR_ORGANIZATION_ID';const groupId = 'GROUP_ID_TO_GET'; // ID of the group
const queryParams = '?with=assets'; // Exampleconst apiUrl = `https://api.tallyfy.com/organizations/${orgId}/groups/${groupId}${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 group ${groupId}:`); console.log(JSON.stringify(data, null, 2));}).catch(error => { console.error(`Error getting group ${groupId}:`, error);});
import requestsimport jsonimport os
access_token = os.environ.get('TALLYFY_ACCESS_TOKEN', 'YOUR_PERSONAL_ACCESS_TOKEN')org_id = os.environ.get('TALLYFY_ORG_ID', 'YOUR_ORGANIZATION_ID')group_id = 'GROUP_ID_TO_GET'api_url = f'https://api.tallyfy.com/organizations/{org_id}/groups/{group_id}'
headers = { 'Authorization': f'Bearer {access_token}', 'Accept': 'application/json', 'X-Tallyfy-Client': 'APIClient'}
params = { 'with': 'assets' # Example}
try: response = requests.get(api_url, headers=headers, params=params) response.raise_for_status()
group_data = response.json() print(f'Successfully retrieved group {group_id}:') print(json.dumps(group_data, indent=4))
except requests.exceptions.RequestException as e: # Error handling... print(f"Request failed: {e}")except json.JSONDecodeError: print("Failed to decode JSON response")
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;import java.util.Map;import java.util.stream.Collectors;
public class GetGroup { 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 groupId = "GROUP_ID_TO_GET"; String baseUrl = String.format("https://api.tallyfy.com/organizations/%s/groups/%s", orgId, groupId);
Map<String, String> queryParamsMap = Map.of("with", "assets"); // Example String queryParams = queryParamsMap.entrySet().stream() .map(entry -> URLEncoder.encode(entry.getKey(), StandardCharsets.UTF_8) + "=" + URLEncoder.encode(entry.getValue(), StandardCharsets.UTF_8)) .collect(Collectors.joining("&", "?", ""));
String apiUrl = baseUrl + (queryParamsMap.isEmpty() ? "" : queryParams);
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") .GET() .build();
try { HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString()); if (response.statusCode() == 200) { System.out.println("Successfully retrieved group " + groupId + ":"); System.out.println(response.body()); // TODO: Parse JSON } else { // Error handling... System.err.println("Failed. Status: " + response.statusCode()); } } catch (IOException | InterruptedException e) { // Error handling... System.err.println("Request failed: " + e.getMessage()); } }}
package main
import ( "fmt" "io/ioutil" "net/http" "net/url" "os")
func main() { accessToken := os.Getenv("TALLYFY_ACCESS_TOKEN") orgId := os.Getenv("TALLYFY_ORG_ID") groupId := "GROUP_ID_TO_GET" baseUrl := fmt.Sprintf("https://api.tallyfy.com/organizations/%s/groups/%s", orgId, groupId)
queryParams := url.Values{} queryParams.Add("with", "assets") // Example
apiUrl := baseUrl + "?" + queryParams.Encode()
client := &http.Client{} req, err := http.NewRequest("GET", apiUrl, nil) // Error handling...
req.Header.Set("Authorization", "Bearer "+accessToken) req.Header.Set("Accept", "application/json") req.Header.Set("X-Tallyfy-Client", "APIClient")
resp, err := client.Do(req) // Error handling... defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body) // Error handling...
if resp.StatusCode != http.StatusOK { // Error handling... fmt.Printf("Failed. Status: %d\nBody: %s\n", resp.StatusCode, string(body)) return }
fmt.Printf("Successfully retrieved group %s:\n", groupId) fmt.Println(string(body)) // TODO: Unmarshal JSON}
A successful request returns a 200 OK
status code and a JSON object containing a data
field with the group’s details.
{ "data": { "id": "GROUP_ID_TO_GET", "name": "Sales Team", "description": "Handles all sales inquiries.", "logo": "https://.../group_logo.png", // Included if requested with 'with=assets' "members": [1001, 1005], "guests": ["client.a@example.com"], "created_at": "2023-03-10T09:00:00Z", "updated_at": "2024-04-20T10:00:00Z", "deleted_at": null }}
If the group ID is not found or you lack permission, a 404 Not Found
or 403 Forbidden
error will be returned.
Modify this group’s details or members.
Remove this group.
About Tallyfy
- 2025 Tallyfy, Inc.
- Privacy Policy
- Terms of Use
- Report Issue
- Trademarks