1

I am currently on ActiveCollab V4 and using the following API call:

https://xyz.manageprojects.com/api.php?path_info=projects/{props.projectID}/milestones&auth_api_token=1234-zyx

How do I configure the API for ActiveCollab V5? I have a a copy of my data in V5 instance.

Ilija
  • 4,105
  • 4
  • 32
  • 46
BobG
  • 21
  • 2

2 Answers2

1

Since this is the top Google search result and it didnt help me I want to share what I figured out. It works with our ActiveCollab 5.x on prem installation.

curl -X POST  -H "Accept: Application/json" -H "Content-Type: application/json" -k https://activecollabURL/api/v1/issue-token -d '{"username": "xyz@domain.com", "password": "JohnDoe", "client_name": "Random","client_vendor":"Random" }' | grep }| python -mjson.tool
Biorez
  • 59
  • 8
0

Version 5 of ActiveCollab has a whole new API. It is no longer possible to send the token via GET parameter. Instead, it needs to be sent in a request header.

This answer describes how to authenticate, obtain the token, and use it to make requests:

https://stackoverflow.com/a/34685298/338473

First request that you make during authentication will return all accounts that you have access to, and intent that you use to authenticate with an account that you want to get a token from. This means that you need to know the ID of an account that you want to work with. When you know that, just loop through the list of accounts until you find the account that has the name same as your ID. Use the url for that account as a base for all future API requests (/api/v1/issue-token-intent mainly).

Please check the answer that I already mentioned for exact commands and steps.

Ilija
  • 4,105
  • 4
  • 32
  • 46
  • Thanks Illja. Since I am being challenged to select one of 3 active collab accounts when i login via the URL. How do I go about adding that when I am trying to login via the suggested method. – BobG Aug 10 '17 at 13:30
  • Illja, if i need to get the Token so I can user it – BobG Aug 10 '17 at 18:56
  • Illja, is there a way in v5 to get the API token as an Administrator when I login on the web? Similar to how I got it in v4? – BobG Aug 10 '17 at 19:10
  • Illja, any thoughts on my two comments? I need to be able to generate the token. – BobG Aug 11 '17 at 14:02
  • Tokens can be obtain programmatically only, not via interface. Since first request returns all accounts that you have access to, you need to know which one you want to authenticate with, and than find it in the list (check out the `name` attribute of each account to find the one that you need). If you are using PHP, this library can help (it abstracts most of the mechanics of authentication and API calls): https://github.com/activecollab/activecollab-feather-sdk – Ilija Aug 12 '17 at 10:34
  • Thanks Illja. So using Zapier to "Copy Token" or to "Copy Account URL" does not return the token I will need? I want to easly to be able to obtain a the data with the call from the product KlipFolio like I did with v4. I am finding it a little more cumbersome and/or difficult in v5. I think it is because I do not understand all the mechanics of v5. I think we just need some guidance. – BobG Aug 13 '17 at 12:35
  • Token on Zapier page is managed by the Zapier integration, and it is not mean to be used for anything else. Zapier integration may change it, remove it, etc, so any external code that relies on it may break without prior warning. Answer that I mentioned above has a couple of simple commands that you can use to get your token programmatically. – Ilija Aug 15 '17 at 05:11