When you log in to TrainerCentral, you can see an ID (<orgId>) in the URL which will be a number.
Example: https://trainercentral.com/#/portal/<orgID>/sessions/upcoming?sort=1
This <orgID> is used in the request URL of the APIs listed below. If you have customized the URL for your organization profile, then the customized name will be visible in the URL instead of the orgID. Both the URL and orgID of all your portals will be returned as response in the View organization portal API call.
View organization portals
The orgId with the "true" value in the "isDefault" parameter is the currently active organization portal ID.
Description: To fetch the list of all the organization portals of a user.
Request URL: /api/v4/org/portals.json
Method: GET
OAuth scope: TrainerCentral.portalapi.READ
Sample response
- {
- "portals": [
- {
- "planName": <planName>,
- "isTrial": "false",
- "orgLogoUrl": <orgLogoUrl>,
- "url": <url>,
- "referrer": "1",
- "isDefault": "false",
- "portalName": <portalName>,
- "currentUserRole": "0",
- "createdBy": <createdBy>,
- "createdTime": "1502194325666",
- "id": <orgId>,
- "isLogoExists": "false",
- "zsoid": <orgId>