Testing API Connection
This article documents how to test the Huddle API connection using Postman on a simple basis to get the auth token. Note that you need to have setup a ClientId for access with Support to get this. Your account must also include this facility for this to be setup.
It is broken down in the to methods for this:
- Client Credentials
- Auth Code
- Troubleshooting
- Further Reading
1. Client Credentials
For this Client Creds method, you can use the Postman application to test this. You can create a new collection and add a new request to it, like this:
On the request, set it to POST and to https://login.huddle.net/token if you are on the Global server. If you are on our FedRAMP server, you should be using https://login.huddle.com/token. You can tell which server you are using by if your Huddle address ends with .net for Global or .com for FedRAMP.
Go to the Body part and you need to populate this with:
- client_id: What was confirmed as the ClientId by Support
- client_secret: What was confirmed as the client secret by Support. This should be kept safe.
- grant_type: client_credentials
- redirect_uri: What was defined for this when Support set this up. This needs to be confirmed with Support as it is possible to leave this empty (NULL) but this may be problematic to use. If not confirmed, it will default to NULL. We can update this in Support, if need be, but the default value we recommend, if you do not know what this should be, is: urn:ietf:wg:oauth:2.0:oob
If you then send that in Postman, you will receive an access token, as shown:
The access token is then used in the headers of your next request, as per the guide on Home · Huddle/huddle-apis Wiki · GitHub
2. Authorization Code
For the Auth Code method, this is a two step process. This can be tested, first using a browser, by navigating to the following, replacing CLIENTID and REDIRECTURI accordingly. If using our FedRAMP server instead of our Global server, replace '.net' with '.com'
https://login.huddle.net/request?response_type=code&client_id=CLIENTID&redirect_uri=REDIRECTURI
This will prompt you to login to Huddle as user. After logging in, you be presented with an access code.
Next you would use Postman to do the next part, with that access code.
On the request, set it to POST and to https://login.huddle.net/token if you are on the Global server. If you are on our FedRAMP server, you should be using https://login.huddle.com/token. You can tell which server you are using by if your Huddle address ends with .net for Global or .com for FedRAMP.
Go to the Body part and you need to populate this with:
- client_id: What was confirmed as the ClientId by Support
- grant_type: authorization_code
- redirect_uri: What was defined for this when Support set this up. This needs to be confirmed with Support as it is possible to leave this empty (NULL) but this may be problematic to use. If not confirmed, it will default to NULL. We can update this in Support, if need be, but the default value we recommend, if you do not know what this should be, is: urn:ietf:wg:oauth:2.0:oob
- code: The access code received in the previous part
If you then send that in Postman, you will receive an access token, as shown:
The access token is then used in the headers of your next request, as per the guide on Home · Huddle/huddle-apis Wiki · GitHub
3. Troubleshooting
Possible errors you might receive and their resolutions:
- The client is forbidden.
For the Auth Code method, this suggests the ClientId hasn't been added and approved to every company for every account holding a workspace that the user trying to login to the API is a member of a team in. This would need to be raised to Support to see if it is possible to add the ClientId to all the companies involved.