LiquidPlanner Classic Forum
Add comment to task
I wish to add a comment to a task with the API
It seems I must use POST
https://app.liquidplanner.com/api/v1/workspaces/workspace_id/treeitems/treeitem_id/comments ?
I have tried using it and it seems to work sometimes and others not. I add the tree item id as my task
comment.item_id ??? What is this? I have tried using 0 and it worked a couple of times and added 2 comments. I tried other values and sometimes it succeeds, but when I look at the comments it isn't there. Many times I just get a 500 error even though I am doing something which worked previously. Any help with this please?
Posted by Rob Freer over 3 years ago
Developer Docs missing information
Hello, what happened to the developer docs?
Previously we were able to view url and body params in the docs (https://web.archive.org/web/20200813181052/https://developer.liquidplanner.com/reference), however the endpoint reference doesn't appear to include meaningful information anymore. Is there anywhere else the available parameters for each endpoint are included?
Posted by [email protected] about 2 years ago
Is it possible to create a sub-folder at a certain position through the API?
I am able to create a folder by calling https://app.liquidplanner.com/api/v1/workspaces/:id/folders, but the folder is put at the bottom of the list.
I am also able to change its position by calling https://app.liquidplanner.com/api/v1/workspaces/:id/folders/:id/move_after, but this basically means two separate api calls.
The question is if the folder can be created at a certain position with only one call.
Thank you
Posted by George Matache almost 3 years ago
How to check contents of folder?
Hi There,
I'm wanting to be able to look at a folder through the API and find out what items are contained within the folder. Is that possible?
The ultimate goal is to be able to automatically close folders where all items contained within are done. I can do this in the reverse, brute-force method by finding a folder id and then parsing all items for the folder parent but that seems quite wasteful.
Thanks,
Joe.
Posted by Joe Hasty almost 3 years ago
Need sample CURL code to create a project
*Posted on behalf of gemberlingb. Original posting date 2013-12-11*
I can do the following Curl statement in PHP and list all projects in my workspace. I would like to see an example of a PHP Curl statement like this that will create a project.
```
$url = "https://app.liquidplanner.com/api/workspaces/XXXXX/projects";
$conn = curl_init();
curl_setopt($conn, CURLOPT_HEADER, 0);
curl_setopt($conn, CURLOPT_HTTPHEADER, array("Content-type: multipart/form-data"));
curl_setopt($conn, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($conn, CURLOPT_ENCODING, "");
curl_setopt($conn, CURLOPT_USERPWD, $_SESSION['email'] . ":" . $_SESSION['pwd']);
curl_setopt($conn, CURLOPT_URL, $url);
curl_setopt($conn, CURLOPT_SSL_VERIFYPEER, 0);
$response = curl_exec($conn);
curl_close($conn);
print_r($response);
```
Posted by LiquidPlanner Support over 4 years ago
Uploading a file to the task. [PHP] [cURL] [REST API]
*Posted on behalf of John Z. Original posting date 2012-11-26.*
Hello, I am using the php client that you can get on [github](https://github.com/jonoxer/php-liquidplanner). I am having trouble uploading a file to a task.
Well, this file is actually a string, and I want to upload that string as the file to the task. Below are two functions that I am using that I added to the client.
```
$data = the string that I want uploaded as a txt file.
$taskid is the correct id for the task.
public function attachDocument($data, $taskid) {
$encodedData = array('attached_file' => $data, 'file_name'=>'testing.txt');
$url = $this->serviceurl . '/tasks/' . $taskid . '/documents';
$response = $this->lp_attach_file($url, $data);
return($response);
}
private function lp_attach_file($url, $data) {
/* Set up the CURL object and execute it */
$conn = curl_init();
curl_setopt($conn, CURLOPT_HEADER, false); // Suppress display of the response header
curl_setopt($conn, CURLOPT_HTTPHEADER, array("Content-type: multipart/form-data"));
curl_setopt($conn, CURLOPT_RETURNTRANSFER, true); // Return result as a string
curl_setopt($conn, CURLOPT_POST, true); // Submit data as an HTTP POST
curl_setopt($conn, CURLOPT_POSTFIELDS, $data); // Set the POST field values
curl_setopt($conn, CURLOPT_ENCODING, ""); // Prevent GZIP compression of response from LP
curl_setopt($conn, CURLOPT_USERPWD, $this->email . ":" . $this->password); // Authenticate
curl_setopt($conn, CURLOPT_URL, $url); // Set the service URL
curl_setopt($conn, CURLOPT_SSL_VERIFYPEER, false); // Accept any SSL certificate
$response = curl_exec($conn);
curl_close($conn);
/* The response is JSON, so decode it and return the result as an array */
$results = json_decode($response, true);
/* Check for Throttling from the API */
if ((isset($results['type']) && $results['type'] == "Error") && (isset($results['error']) && $results['error'] == "Throttled")) {
//We're being throttled. Waith 15 seconds and call it again.
$this->throttle_message();
sleep($this->throttlewait);
return $this->lp_post($url, $data);
}
return $results;
}
```
I get a response from curl_exec, which is: ```
"{"type":"Error","error":"BadArgument","message":"Expected a hash of attribute values for document parameter"}"
```
I have been messing with this a while now, if anyone could help me out or give me some examples I would really appreciate it! Let me know if I can provide you with any more info about the program. Thanks!!
Posted by LiquidPlanner Support over 4 years ago
How to update ownership and estimates correctly ?
*Posted on behalf of Thibaud. Original posting date 2014-10-27.*
Hi,
We use LiquidPlanner (LP) to manage projects (mostly for planning) but JIRA for the time tracking. We developped an application that synchronises JIRA to LP (one-way). So we can create new tasks, update info (owner/assignee, low/high estimate, description, etc.). We don't mind much about work log (who does what) we just want to make sure the time left, assignee and done status of tasks in JIRA are properly updated in LP.
With the new changes, the part that I don't quite get is the multiple assignments. As there is no way to test it before it's too late, this scares me a bit because having the synchronization work became critical in our organization.
When all I want is to make sure the owner of the task reflects the assignee in JIRA and that the remaining estimates (low and high) are up to date (we use the track_time service to update the difference between JIRA and LP), what are the precautions I have to take ? Because I read that assigning the same person to a task will throw an error. Do I use the track_time service the same way I used it in the past (but adding the person_id) for time tracking ? Do I have to delete extra assignments ? If we want to have only one assignee, do we simply update an assignment based on its ID ?
My plan is to do this:
1- update all task info except estimates and ownership
2- update the owner:
2.a. if the task.assignments[0].person_id == <owner id> => do nothing (is there a risk of having multiple assignements?)
2.b. otherwise, send a request to /update_assignment with {"assignment_id": task.assignments[0].id, "person_id": <owner id>}
3- update the estimates (I use the same request to /time_tracking with the difference in estimates in JIRA and LP and the person_id being the <owner id>)
Is that OK ? I have a feeling that there's a risk of having assignments with person_id: 0 (Unassigned user) or worse, if people for a reason or another change ownership (and log work??) in LP, there will be multiple assignments.
Sorry if my questions aren't clear enough, if you need any clarification, don't hesitate to ask. Thanks for the help.
- Thibaud -
Posted by LiquidPlanner Support over 4 years ago
Is there a way to make an API Token Read-Only?
Hello,
I have successfully written a an LP API program that automatically gets the data that I wish to process and processes the data. With this LP API program I wish to always just read. I was wondering if there was a way to set an API Token to "Read-Only"? And if not, would this potentially be considered in the future?
Thanks,
Bart
Posted by [email protected] almost 2 years ago
Creating a task - Error 400
*Posted on behalf of a customer. Original post date 2013-07-08*
I'm developing an integration in Salesforce to automate the creation of tasks in LP. However, I keep receiving errors when attempting to create a task. The request details are as follows:
Endpoint URL: https://app.liquidplanner.com/api/workspaces/xxxxx/tasks
Method: POST
Request Body: {"task": {"name": "learn the API"}}
RESPONSE:
status_code: 400
status: bad request
response body: {"type":"Error","error":"BadArgument","message":"Expected a hash of attribute values for task parameter"}
I followed the tutorial on how to GET details from LP via Salesforce, which works perfectly, but creating a task in LP from Salesforce is proving very difficult.
Posted by LiquidPlanner Support over 4 years ago
CRUD webhooks via the API?
*Posted on behalf of a customer. Original posting date 2015-03-13.*
Is it possible to create/update the webhooks via the API? I know I can get a list of webhooks, but say I wanted to enable or disable them, is that possible?
Posted by LiquidPlanner Support over 4 years ago