Skip to content

Conversation

falsovsky
Copy link

@falsovsky falsovsky commented Sep 9, 2019

Hi there,

In your self hosted examples, you have the endpoint as "https://my.company.com/projects", but if you try to add any server based on that example (Eg. "https://zbr.blah.com/projects"). You always get:

Invalid response from "https://zbr.blah.com/projects/api/v5/issue-token". JSON expected, got "text/html;charset=UTF-8", status code "200"

After searching for that error, I've found this closed issue with the solution from 2018: #18

That specifies that the endpoint URL shouldn't have the /projects suffix, but in your README and self hosted examples its still that way.

Here is a PR that changes the examples to make them work again.

@falsovsky
Copy link
Author

I also think that the API should automatically be set to 5 in here: https://github.com/activecollab/activecollab-feather-sdk/blob/master/src/Authenticator/SelfHosted.php#L29

If you want, I'll open another PR.

@ilijastuden
Copy link
Member

Correct version of ActiveCollab API is v1, not v5. API version is not tied to version of the self-hosted package. If there's a major change to the way API works, we'll bump the version to v2, regardless of the version of self-hosted package.

Therefore, you should use URL's like /api/v1/issue-token, not /api/v5/issue-token.

Regarding /projects problem in the referenced issue, it was error of base URL, not the SDK. You can install ActiveCollab on all sorts of places:

  1. Domain, like myprojects.com, in which case API will be myprojects.com/api/v1,
  2. Subdomain projects.mycompany.com, in which case API will be projects.mycompany.com/api/v1,
  3. Sub-directory mycompany.com/projects, in which case API will mycompany.com/projects/api/v1

etc. Examples are what most people were doing at the time of writing (installing ActiveCollab in sub-directory on their company's website).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants