Git Product home page Git Product logo

activecollab-feather-sdk's People

Contributors

7elix avatar bahuma20 avatar ilijastuden avatar kostajh avatar michaeljs1990 avatar mickaelandrieu avatar svenrtbg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

activecollab-feather-sdk's Issues

Can you filter tasks between dates and labels?

Can you filter tasks between dates and labels? Something like this?

Filter on dates:
/projects/{project_id}/tasks?from=YYYY-MM-DD&to=YYYY-MM-DD

Filter on labels:
/projects/{project_id}/tasks?label=LABELNAME

Post comment without (email) notification

When adding comments to issues a flag to ignore-notification / do-not-send-notification email should exist. This makes sense for comments that are added by robots/web hooks. Those should not always trigger email notifications.

Loading time

Everything working fine but when getting the response whole page loading and it's taking lot of time when we trying sub requests like sub-tasks and discussion to get lot of time

How to use API

We want to use AC for many projects that we have. We will need to create many projects and task which need to be assigned to loads of users. We will also need to download timesheet data for reporting in other tools. We are exploring using APIs to create all the related configuration.

Is there a how to document for end users on how to use APIs?

Missing feature GET task details without project-id

For some endpoints the task-id is the only necessary detail (/comments/task/{task-id}). But for other endpoints the task-id has to be supplied in combination with the project-id (/projects/{project-id}/tasks/{task-id}).

For many use cases only the task-id is known. Currently there seems to be no solution to retrieve tasks details (especially the the project-id) based on the task-id.

In order to work with tasks there should be a endpoint to get task details (the task's project-id) based on the id

(GET) /tasks/{id}

GET with Query Parameters ?

How are we supposed to specify Query Parameters with this SDK when using GET ?
I don't see any second parameter for the Client::get method.

For simple things i can do this :

$client->get('reports/run?type=InvoicesFilter');

But for more advanced parameters, it becomes a mess.

Can get issue token with cURL, Postman or SDK

Sorry if this is not the right place but I can't find help for my problem

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 protected]&password=XXXXXX' https://app.activecollab.com/XXXXXX/api/v1/issue-token

Any idea?

Authentication Issues

Hi, there seams to be some issue with the cloud authentication.
Started this morning, when the new version of AC was released

ActiveCollab\SDK\Exceptions\Authentication: Invalid response

Looking deeper into the issue, seams to be related to the /api/v1/external/login endpoint

Unable to get a token with the API using fetch/axios or Postman

I don't know if it's the right place or event if this repo is maintain, but I'll give it a chance!

When trying to get a auth token (using this URL pattern; https://app.activecollab.com/XXXXXX/api/v1/issue-token), I got that response:

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

I tried with fetch(), axios and Postaman, still the name result.

Here's a piece of what I am using:

        async getToken(username, password) {

            const data = {
                username,
                password,
                client_name: "...",
                client_vendor: "..."
            }

            try {
                const token = await push('/api/issue-token', data)
                this.token = token
                setToken(token)
            } catch (error) {
                console.error(error)
            }
        }

The push() method:

const push = async (route, data = {}) => {
    try {
        const config = {
            headers: {
                 'Content-Type': 'application/json',
            },
        }

        const response = await axios.post(route, data, config)

        return response.data
    } catch (error) {
        console.error(error)
    }
}

Note that the /api path is a proxy of https://app.activecollab.com/XXXX/api/v1.

Uncaught exception when trying to connect

Hello,

This issue started today when accessing the API. No matter what login credentials I use, it does not seem to work.

Thanks!

PHP Fatal error:  Uncaught exception 'ActiveCollab\SDK\Exceptions\Authentication' with message 'Invalid response' in vendor/activecollab/activecollab-feather-sdk/src/Authenticator/Cloud.php:126
Stack trace:
#0 test-ac.php(13): ActiveCollab\SDK\Authenticator\Cloud->issueToken(000000)
#1 {main}
  thrown in vendor/activecollab/activecollab-feather-sdk/src/Authenticator/Cloud.php on line 126

Data inconsistency

Hello Devs,

I have a issue with the the output of the API.

I'm trying to build a system where i integrate active collab too and trying to fetch tasks and tasks related time records. All works fine but there is inconsistency in the time record values.

Please see the screenshot below:
https://prnt.sc/wfr5ak

In the above screenshot the time tracked values are 0.10 and 0.26 respectively.

Upon fetching the time records via the API with endpoint /projects/1/tasks/1/time-records, the values are different. The screenshot for the response array is attached below:
https://prnt.sc/wfr4wz

The above screenshot have values 0.17 and 0.46 respectively which is completely wrong!

I'm not sure why that is happening? Can you guys let me know if i'm doing anything wrong there?

Invalid response. JSON expected

Fatal error: Uncaught exception 'ActiveCollab\SDK\Exceptions\Authentication' with message 'Invalid response. JSON expected, got "text/html;charset=UTF-8", status code "200"' in D:\webroot\activecollab-feather-sdk\src\Authenticator\SelfHosted.php:76 Stack trace: #0 D:\webroot\activecollab-feather-sdk\get_projects.php(15): ActiveCollab\SDK\Authenticator\SelfHosted->issueToken() #1 {main} thrown in D:\webroot\activecollab-feather-sdk\src\Authenticator\SelfHosted.php on line 76

Below is the code
require_once DIR . '/vendor/autoload.php';

// Construct a self-hosted authenticator. Last parameter is URL where your Active Collab
$authenticator = new \ActiveCollab\SDK\Authenticator\SelfHosted('Some Company Name', 'Report', 'some email', 'some password', 'https://xxx.yyy.com/projects');

// Issue a token
$token = $authenticator->issueToken();

if ($token instanceof \ActiveCollab\SDK\TokenInterface) {
print $token->getUrl() . "\n";
print $token->getToken() . "\n";
} else {
print "Invalid response\n";
die();
}

// Create a client instance
$client = new \ActiveCollab\SDK\Client($token);

// Make a request
print_r($client->get('projects'));

Project ID in recurring task ID

Hi, it seems like there is an issue with the field: created_from_recurring_task_id. As I understand it this field, should contain the ID of the task, that the recurring task was created from, but instead it seems to contain the project ID.

Doc updates

The url to the docs is wrong seems to need /index.html eg https://developers.activecollab.com/api-documentation/index.html

and in the Connecting to Self-Hosted Active Collab Accounts code eg the /projects needs removed, eg.

This line:
$authenticator = new \ActiveCollab\SDK\Authenticator\SelfHosted('ACME Inc', 'My Awesome Application', '[email protected]', 'hard to guess, easy to remember', 'https://my.company.com/projects');

Should be:
$authenticator = new \ActiveCollab\SDK\Authenticator\SelfHosted('ACME Inc', 'My Awesome Application', '[email protected]', 'hard to guess, easy to remember', 'https://my.company.com/');

Document parameters like "page"

Hi and thank you for this wonderful SDK. We were wondering why comments were missing and found the undocumented ?page=INT parameter. I can't find any information about this and other parameters in the API documentation.

Is it documented anywhere? Which parameters exist?
Is there any chance to disable paging and return all results for a query like
https://my.ac.com/api/v1/comments/task/9198/all (which doesn't exist - /all is not allowed)

autoload?

all of the examples point to "autoload.php".. but there is no autoload.php in this repo. i have no idea what that is.

manually interfacing with the cloud api via curl commands is failing. trying to confirm things are broken by using this SDK, but the examples don't work since they reference this autoload.php

Can't authenticate

Hi,

I have made a custom AC Timer for our company iValue.
https://ivalue.be/timer/

Since today we have an authentication issue.
When I want to login I get following error 'Invalid response'.

I am user Active Collab Feather SDK to communicate with the API
https://github.com/activecollab/activecollab-feather-sdk

The exception is throwed when I instantiate the authenticator:
$authenticator = new \ActiveCollab\SDK\Authenticator\Cloud( IV_APPLICATION_COMPANY, IV_APPLICATION_NAME, $username, $password );

Can you please help?

Thank you.

Kind regards,

Maarten

Missing mime-type for upload-files (>= PHP 5.5)

When having a PHP version >= 5.5 (which all production env should have at this point), we end on line 101 for uploading an attachment.

Not setting the mime_type is quite annoying for daily usage in ActiveCollab, which can open images et.al. inlined. When mime_type becomes octet-stream, you have to download them first.

Fast Solution
CURLFile also takes in mime as a second parameter.
https://www.php.net/curlfile

in src/Connector line 101:
$post_data['attachment_' . $counter++] = new CURLFile($path);

should be:
$post_data['attachment_' . $counter++] = new CURLFile($path, $mime_type);

It could also be nice to have a small tutorial on upload-files:

$response = $client->post(
    'upload-files',
    [],
    [[ "/tmp/filename.jpg", mime_content_type("/tmp/filename.jpg') ]]
);
print ($response->getJson());

Support HTTP redirects

ActiveCollab API returns redirect codes in some cases, e.g. when a task was moved to another project. If I query the API for such moved task, it returns 301 and redirect_url parameter with JSON in the response body.

Tinkering with Connector class I found that this can be fixed with

curl_setopt($http, CURLOPT_FOLLOWLOCATION, true);

at least for GET requests. Currently the redirects have to be handled on the application level. Can you modify the cron setup so redirects are handled transparently on the library level?

Uncaught InvalidArgumentException

Uncaught InvalidArgumentException: Account #randomnuber not loaded i'm gettting Fatal error exact error i'm not able to catch if we use wrong username or password could help me out how could i fix these issue

Attachments are not working

Attachments are not working for me. I may be doing something wrong, but I'm getting validation errors as if I'm not sending any data.

I'm using the following:

	    $response = $this->client->post(
	    	'projects/'.$project.'/tasks',
		    [
			    'name' => $task,
			    'body' => '<a href="'. env('APP_URL').'/ticket/'.$id .'" target="_blank">'.env('APP_URL').'/ticket/'.$id .'</a><br><br>'.$body,
			    'assignee_id' => $person
		    ],
		    $attachments
	    );

It works fine if I leave off the attachments, but when I get the validation errors:
Task summary is required
Value of task_list_id field is required
Please select a project

Am I doing something wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.