Skip to content

Instantly share code, notes, and snippets.

@aleksandar-olic
Last active December 26, 2019 12:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save aleksandar-olic/e04207c7712ba9f65fb7 to your computer and use it in GitHub Desktop.
Save aleksandar-olic/e04207c7712ba9f65fb7 to your computer and use it in GitHub Desktop.
Getting Tokens for Active Collab Cloud Instances

1. Send a POST request to "https://my.activecollab.com/api/v1/external/login" with "email" and "password" as parameters.

You should get the following response:

{
 accounts = ({
  class = FeatherApplicationInstance;
  "display_name" = "A51 (ID: 1)";
  name = 1;
  url = "https://app.activecollab.com/1";
  } // plus any other instances you have access to
);
 user = {
  "avatar_url" = "https://my.activecollab.com/avatars/user_183394.png";
  "first_name" = Tomislav;
  intent = "long string";
  "last_name" = "Todorov Filipovic";
 };
}

"accounts" are instances that you have access to:

  • "class" - a type of Active Collab instance (FeatherApplicationInstance is the current, new version).
  • "name" - ID of the cloud instance
  • "display_name" - the name of the instance like "Company Name (ID: #)"
  • "url" - URL to your Active Collab instance

"user" contains the URL of the user's avatar, first name, last name, and the intent for the token.

2. Send a POST request to “https://app.activecollab.com/1/api/v1/?format=json&path_info=%2Fissue-token-intent” with "intent", "client_vendor", and "client_name" as parameters. Just switch "https://app.activecollab.com/1" with your instance's URL.

@lukifer
Copy link

lukifer commented Dec 31, 2015

FYI: The API URL above threw an error, but I was able to get it working with the following URL instead: https://app.activecollab.com/1/api/v1/issue-token-intent?format=json

@bennettscience
Copy link

You can get a token using https://app.activecollab.com/1/api/v1/issue-token (replacing with your cloud URI) by sending a POST request with username, password, client_name, and client_vendor in the JSON. The second URL above threw a 500 error.

@marutim
Copy link

marutim commented Jul 18, 2017

@malizmaj I tried the above (https://my.activecollab.com/api/v1/external/logi ) and gets a response saying I need to double check my password. But this is the password that I use to login to https://my.activecollab.com/ then choose the project.

@bennettscience What value do we add to client_name and client_vendor? I tried adding the team I am added to in "client_name" and My app name in client_vendor. This threw a 500 error

Guys any help will be highly appreciated!!

Thank You

@RoryDungan
Copy link

RoryDungan commented Jan 9, 2018

The method from the documentation using https://app.activecollab.com/1/api/v1/issue-token didn't work for me (just gave me a 500 error with no body) but this did. Thank you!

@RoryDungan
Copy link

For anyone else's benefit, once you have a token you need to put it in the X-Angie-AuthApiToken header on your other requests. I don't believe the current API documentation specifies which header name to use, but that one worked for me.

@ivankristic
Copy link

If youre having issues and dont know what to do, just open official PHP sdk, and go through the code, youll find all of the working endpoints there.

At this point

  • login https://my.activecollab.com/api/v1/external/login
  • token https://app.activecollab.com/<ACCOUNT_ID>/api/v1/issue-token-intent
  • other content https://app.activecollab.com/<ACCOUNT_ID>/api/v1/<CONTENT>

note subdomain distinction - my | app
also you can send all post requests with json body and Content-Type: application/json header
and what @RoryDungan said, X-Angie-AuthApiToken: <TOKEN> is header

official documentation is misleading, and the whole api is just a bad experience

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment