activecollab / activecollab-feather-sdk Goto Github PK
View Code? Open in Web Editor NEWPHP SDK for ActiveCollab 5 and 6 API
Home Page: https://activecollab.com
License: MIT License
PHP SDK for ActiveCollab 5 and 6 API
Home Page: https://activecollab.com
License: MIT License
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
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.
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
I have tested activecollab api using postman.
https://my.activecollab.com/api/v1/external/login?email="***@gmail.com"&password="****"&type="Member"
The response is: { "is_ok": false, "message": "Login failed" }
Please some lead me.
Thanks
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?
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}
In PHP 7, the CURLOPT_SAFE_UPLOAD
flag as set in Connector.php in the post
method does not work in PHP 7 (seen here). This raises an ErrorException with the message:
setopt(): Disabling safe uploads is no longer supported
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 anyone tell me how to find our baseurl of our api?
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?
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
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
.
I am having huge troubles connecting to the API for activecollab 5 using curl commands, is it possible to use this library to help?
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
Active Collab API documentation link goes into 404 since https://blog.activecollab.com/labs/ was changed and https://labs.activecollab.com/nightly-activecollab-api/v1/authentication.html is gone.
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?
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'));
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.
Hello, as per this SO question, it would be great if the pagination headers could be exposed through the SDK
http://stackoverflow.com/questions/40020003/get-pagination-results-in-active-collab-api
Thanks
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/');
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)
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
I'm currently using the ActiveCollab API and looking for the new Task Dependencies. Looks like they're not implemented yet.
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
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());
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: 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
I'm still getting this error with the latest release. Not sure where to tell which version we are on, but I'm still getting the error.
It doesn't make sense to me to access the project, so that I will have to access the task using its global id rather than the project task id, which is the "task_number" field
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.