How to Extract User Information from Projects
Overview
This guide demonstrates how to extract user information (name, email, roles, permissions) for each project using Cintoo API. This can be achieved by making two separate API calls and joining the results based on user IDs.
Prerequisites
- a valid Cintoo API access token
- access to the Cintoo Cloud API, with necessary permissions to fetch project and user data
- familiarity with Python and REST API calls
Workflow
To retrieve user information from individual projects, you will need to:
- Call the
/projects
endpoint to get user IDs and their roles within projects. - Call the
/users
endpoint to get detailed user information. - Join the results based on user IDs to get complete user details, including project-specific roles and permissions.
Python Script
How the code works
- Get Project Users:
- Uses the
/projects
endpoint to get user IDs and roles for each project.
- Uses the
- Get User Details:
- Uses the
/users
endpoint to fetch user information (name, email, etc.).
- Uses the
- Join Results:
- Combines project user roles with user details, resulting in a complete user dataset for each project.
Requirements
- Install the
requests
librarypip install requests
- Replace placeholders (
YOUR_ACCESS_TOKEN
,YOUR_ACCOUNT_ID
) with actual values.
Notes
- Cintoo API uses JWT tokens for authentication, which must be passed in request headers.
- Ensure access token is valid and has necessary permissions to fetch user and project data.
Best Practices
- Use Sandbox environment to test the API calls before running them in production. More about Sandbox.
- Implement error handling to manage API call failures or token expiration.
Additional Information
For more details on Cintoo API endpoints, please look at Cintoo API Documentation.