0

I'm trying to connect to ActiveCollab API but it is impossible. I tried with Postman and cURL but I'm obtain the same result:

{
  "type": "ValueError",
  "message": "DOMDocument::loadXML(): Argument #1 ($source) must not be empty",
  "code": 0
}

This is the command with the endpoint

 curl -XPOST -d 'email=email@gmail.com&password=XXXXXX' https://app.activecollab.com/XXXXXX/api/v1/issue-token

Any idea?

Dani
  • 29
  • 1

2 Answers2

1

I was running into issues getting an API Token as well, albeit on a self-hosted install. I reached out to ActiveCollab support and they pointed me to a Getting Tokens for Cloud Instances.md gist which appears to have slightly different syntax with the use of a different endpoint and an "Intent" variable. Give that a look and see if it helps.

I was finally able to get an API Token with the following curl request

curl --location --request POST 'https://<URL-OF-SELF-HOSTED-VERSION>/api/v7/issue-token' \
--header 'Content-Type: application/json' \
--data-raw '{
    "username": "<YOUR EMAIL HERE>",
    "password": "<YOUR PASSWORD HERE>",
    "client_name": "My Awesome App",
    "client_vendor": "ACME Inc"
}'

Based on what their support folks said, you might have luck on the cloud version with the below, ensuring to add your account ID.

curl --location --request POST 'https://app.activecollab.com/<YOUR-ACCOUNT-ID>/api/v7/issue-token' \
--header 'Content-Type: application/json' \
--data-raw '{
    "username": "<YOUR EMAIL HERE>",
    "password": "<YOUR PASSWORD HERE>",
    "client_name": "My Awesome App",
    "client_vendor": "ACME Inc"
}'
1

Two things that might help:

  1. For the cloud you must use their new authentication method that requires making two requests. You can read more about it here
  1. I've personally run into this exact error when making the second request to issue-token-intent because I was not passing in the parameters correctly. See the curl statement below to see how I got it to work:

    curl --location --request POST 'https://app.activecollab.com/YOURID/api/v1/issue-token-intent' \ 
    --header 'Content-Type: application/x-www-form-urlencoded' \ 
    --data-urlencode 'intent=YOURINTENTID' \ 
    --data-urlencode 'client_name=CLIENTNAME' \ 
    --data-urlencode 'client_vendor=VENDORNAME'
    
Chris Stoll
  • 35
  • 1
  • 6