Podio API Creating comments with additional attributes - podio

I am working on migrating data from multiple app items into one. I was able to move all the data over but I need to move comments and files as well.
I know the API allows you to create comments from an App (which I am doing) but I want to be able to create the comment and pass the original information (message,creator,created_on).
The API documentation doesn't show what are all the "possible" attributes for creating a comment.
Thanks.
Rico.

All details on how to create new comment are here: https://developers.podio.com/doc/comments/add-comment-to-object-22340
{
"value": The comment to be made,
"external_id": The external id of the comment, if any,
"file_ids": Temporary files that have been uploaded and should be attached to this comment,
[
{file_id},
.... (more file ids)
],
"embed_id": [OPTIONAL] The id of an embedded link that has been created with the Add an mebed operation in the Embed area,
"embed_url": The url to be attached
}
Please note, you can't set some of comment's attributes (like: creator, created_on).

Related

Jira API - how to ADD a custom field to an existing issue

Given a project and some issues in it, I want to create a new custom field and populate it for some issues.
I see that the editmeta api returns the list of fields that are already on the issue and can be edited (updated). But how do I edit the metadata itself?
(Motivation: we migrate from another tool and want to preserve some original data after the standard export/import is done)
You will need to add new custom field(s) Jira administration. You cannot add new fields on-the-fly using common "edit issue" method.
If you are admin of whole Jira system, you can add it by yourself. If not, you will need to ask your Jira admin to do it. The new field must be also added to proper issue screens so that the field is available for editing (either from UI or from REST API).
See more here: https://confluence.atlassian.com/adminjiracloud/create-a-custom-field-991923727.html

status change missing from bitbucket comments

Since bitbucket is ending support for mercurial, I am working on a program to automate the move of the projects to sourceforge, which (still) supports mercurial.
Using some sample API 2.0 code to list the repositories on bitbucket, I found that the repo information, loaded from the paginated JSON result, contains links to other information (non-interesting links shortened to ....):
links:
avatar: ....
branches: ....
clone: ....
commits: ....
downloads: {href: https://api.bitbucket.org/2.0/repositories/user/slug/downloads}
forks: ....
hooks: ....
html: ....
issues: {href: https://api.bitbucket.org/2.0/repositories/user/slug/issues}
pullrequests: ....
self: ....
source: ....
tags: ....
watchers: ....
Using the links I can automate getting all of the downloads, and all issues.
The mercurial repository itself, can of course be pulled and pushed quite easily.
Each issue has links as well:
links:
attachments: {href: https://api.bitbucket.org/2.0/repositories/user/slug/issues/1/attachments}
comments: {href: https://api.bitbucket.org/2.0/repositories/user/slug/issues/1/comments}
html: ....
self: ....
vote: ....
watch: ....
I have no way to map a bitbucket user to a sourceforge user, but I can add the individual comments to sourceforge including info on their original poster in text form.
When you change the state of an issue, e.g. closing it, you get an additional comment on bitbucket (with optional text). Unfortunately such comments gathered from the API have no information on the state changes and none of the others links found, provide this information.
Do I need to scrape the individual issues on the bitbucket website to get the changed status information, that can be seen there?
Looking through the JSON that is provided by exporting issues from bitbucket, did see the following top level keys:
attachments:
comments:
components:
issues:
logs:
meta:
milestones:
versions:
and the logs section actually contains the status change information. Trying with a url of the form
https://api.bitbucket.org/2.0/repositories/user/slug/issues/1/logs
but that didn't work.
Although I could automate retrieving the export and logs from the JSON from the zip file exported, I finally stumbled upon this information in the documentation. So the URL to use is
https://api.bitbucket.org/2.0/repositories/user/slug/issues/1/changes
The first changes entry is the creation, so that is less interesting. The rest of the entries overlap with comments. Since the changes include the comment text (if any) you can overwrite the comments with the more complete changes information based on the creation date-time-stamp (which seems equal to the microsecond).

Branch.io api update type. Make previously created link appear on quick links

I created a bunch of links through the API without specifying the type which defaults to 0. This doesn't make the links show on the dashboard under quick links. Now, I would like to make them show there but there doesn't seem to be an option to add a quick link, only create new. Given this, my idea was to use the API to read and update it however, update doesn't seem to allow passing argument type. Any hints on how to overcome this?
I have made a get request, retrieving the whole link details, copied the result, added the branch_key and branch_secret, changed type from 0 to 2 and sent an update request.
I've opened the link with ?debug=true but it doesn't seem to be a way to edit it to make it show on quick links either.
Response code was:
{
"error": {
"code": 400,
"message": "Invalid parameter: type"
}
}
As soon as I remove the type parameter, I get the proper link response with all the data.
The error that you saw is the expected behavior. The "type" key is reserved key and is not able to be changed once you created the link. You can manually set this only when you create the link using the API call. Please do reach out at integrations#branch.io if you have any further questions!
We store API created links and quick links in different DBs due to the volume of each type. This means that it's actually impossible to create a quick link through our public API or SDK. The only place would be from the dashboard. :( Hopefully, you understand our reasoning for doing it this way.

Google Apps Script - google form "go to section based on answer"

I'm trying to create a google form which adapts each question based on the previous response. I realize that while google forms cannot be written dynamically, you can manually add in the option to "go to section based on answer" in the GUI editor.
My question is - is there a way to write this function go to section based on answer in a Google App Script? I will have hundreds of answers for some of my questions and it will not be possible to manually add them in. My answer choices will also be added from a google spreadsheet and automated to change every day.
Any other experiences or tips faking dynamic google forms appreciated.
I know this is old question, but as I was working on the similar problem, I am providing this answer just for reference.
You can create a new section, with desired questions, and continue on it, based only on the answers. You can use something like this code:
// Create multiple choice questionnaire
let aup = form.addMultipleChoiceItem()
.setTitle(NEWCOMER)
.setHelpText('Is this your first time using the App?');
// Creates a new section
var newcomerSection = form.addPageBreakItem()
.setTitle(NEWCOMER_TITLE)
.setHelpText('Please read and comply with Acceptable Use Policy');
// Based on the choice, we either continue to previously created section,
// or on the next section in line. You can also create two sections,
// and jump in the second answer to that section.
aup.setChoices([
aup.createChoice('Yes', newcomerSection),
aup.createChoice('No',FormApp.PageNavigationType.CONTINUE),
]);

Recommendations Bar: Remove read action (remove from my timeline)

The Recommendations Bar seems to work well, but there is not an ability to remove the most recent read action from a user's timeline. As all of the actions are handled by the plugin, there doesn't seem to be a way to get the ACTION_ID generated by the Read.
As such, Facebook will not approve my Read Action with the Recommendation Bar because I can't provide a link in the article that says "Remove from Timeline" that deletes the action from a user's timeline.
You read the /me/news.reads API call for the read action with your url as the object and then use that action id for removal.
I've had the same problem in getting my read action approved. Unfortunately, Facebook doesn't care and will reject your action on the basis that it doesn't provide the user the ability to later delete their actions.
The only way is to build this functionality in manually. The Recommendation Bar Plugin doesn't return the ID for the action after it has been posted to Facebook so you would have to manually query Facebook to get the information back:
$activity = $fb->api('/me/' . $action_id );
print_r( $activity );
You will then have to display the information correct and let the user delete their information from there.
For my site, I had to create a WordPress plugin to do just that. You can see it in action here:
http://www.xtremeps3.com/wp-admin/admin.php?page=facebook-activity/facebook-activity.php
And just as an update, the "social reading" function of the Recommendation Bar has been removed, probably due to the Read action issues (which were reported as a bug several months ago and marked as fixed at the same time as the feature disappeared). It just replicates the Recommend Box functionality now. –