cant_delete_file even if I have the right scopes? - slack-api

Since Slack doesn't support bulk delete, I have searched for alternatives. The search didn't took long, and I stumbled upon this Python script which use Slack's Web API to delete all files that are there for more than 30 days.
After struggling to get the token right, I got a valid token with the scopes files:read and files:write:user.
The script starts, gets the list of files, and sends the request to delete correctly, but the answer from Slack is systematic:
{"ok":false,"error":"cant_delete_file"}
Searching for this error code reveals it is because I don't have the permissions to do erase them.
I can't find any more information, and I'm struggling to know what goes wrong. What is the reason I don't have the permissions?

You need to be authenticated as an admin user to delete a file that belongs to another user.
I would agree that the error message could give more details about the situation.
Edit: this answer is outdated, see this comment.

Related

Get specific logs from SendWithUs with API

I was just trying to get a specific logs from SendWithUs, but cannot really find any info. Googled all around the place. API documentation on SWU does not say how to pull like "email_name" with a specific text in it. I want to pull the logs where "email_name" could be specified or at least "email_name" like '%specificemailname%'. Any ideas?
I will really appreciate every single answer.
There isn't a way to filter logs programatically. Sendwithus has two log API endpoints. One to get information about a log using the receipt_id returned an a send API call. The second lists email event information (opens, clicks, etc) for a given log.
Did you reach out to the support team for help?

Get a review link with Google My Business API

Is there a way to get the link of a review using the GMB APIs?
The closest to what I need is this:
https://www.google.com/maps/contrib/113400145807499011881/place/ChIJSRSm38NhLxMRBgg2EGMZqKc/
Where the first ID (113400145807499011881) is the ID of the user who left the review, and the second ID (ChIJSRSm38NhLxMRBgg2EGMZqKc) is the place ID.
However, the review object returned by the API does not seem to contain enough information to obtain the reviewer user ID.
Thank you,
Guido
I was searching for a way to get the url to the review overview for a specific location via the API too.
After checking the links, IDs ect. in the API Responses and lots of documentations an tuturials i found NO way to get the link over tha API.
BUT a workarround with a few manual steps can help to find the link (I know that is not a final answer to the question, but maybe it is still helpfull)
go to google search, and search for you Location/ Company that contains the reviews
on the right side you should see a pannel that shows the current stars for your location and a link "xxxx Google-Rezensionen"
klick on this link and copy the url in the browser
(optional remove parameters like "&client" ect.
Check this youtube-video of the Step by Step Tuturial to see a tuturial how you can do this.
newReviewUrl is the Parameter if someone read this:
https://developers.google.com/my-business/reference/rest/v4/accounts.locations#urlattributevalue

Tweeting as different user using REST API

I'm currently writing a shop-related site that has it's own community in different social networks. While posting to VKontakte and Facebook is less of an issue (I can understand the concept of "group", and VK actually has an option to write posts using the group's name), Twitter is more troublesome.
Two questions:
Is there even such a thing as "groups" in Twitter? The closest I have seen is lists and timelines, but neither appears to solve my issue.
I cannot give the operator access to the twitter account. VK has a specific option when posting in a group to use that group's name as poster name. How does this work in Twitter?
I need something akin to what lamoda has set up. (It appears to be a user, and every post is labeled as written by that user, however I doubt they give their ops access to the actual twitter account).
P.S.: I'm already done with getting past OAuth and using REST to actually post, thus no code provided. I'm just having trouble with the statuses/update.json call, if that's what I should actually be using.
Talk about simple solutions to simple problems.
It appears I have been overcomplicating. There are no groups in twitter, or even comments at that. You can only post to your own feed or re-post from somebody else's.
Posting to someone's feed (a shop account's, say) is simple enough using that account's pre-generated access token which can be stored in the configs.

Facebook Graph API changed results from /posts today?

I have an iOS app that has been fetching the user's Facebook status updates and location checkins using "/me/posts" for several months. After today's "breaking changes" update, "/me/posts" only returns recent "Like"s. It looks like "/me/statuses" and "/me/checkins" are the new proper places to check for these things. I guess that makes sense, but I saw no documentation anywhere describing these changes or saying that they would happen today. The original documentation about what is specifically returned from the graph API also seems pretty slim.
So my questions are: is this an official change to the API? Where was it specified? Where should I look so I can stay on top of these things and not have my app break for hundreds of users?
Perhaps more importantly: are "/me/statuses" and "/me/checkins" the new proper ways to get this information? Or is there something else?
Always good to keep a (sharp) eye on the Developer Roadmap. These types of changes happen often, but FB usually does a good job of calling them out ahead of time. You've answered your own question as far as whether or not it's an "official" change - you're seeing it in the wild - insofar as how Facebook works, it's official.
Try using the Graph API Explorer. It could be an access token issue.
FYI: I see a similar issue with my application, and I am able retrieve the posts only when I use the Graph API Explorer and the token I get from there.
Update: I found where some of the problems lived. In the app profile in Facebook, pick "Edit Settings" and then go to "Advanced" where you'll see a section called "Migrations". This is mostly switches to show compatibility for various "breaking changes" updates, but it also includes an option for "Include Checkins with Statuses".
Now I know where to look, things are making a bit more sense.

Utterly confused about OAuth and Google Calendar Gadget

I'm working on a Google Calendar Gadget and need to load data for the user from a remote server. It's simple stuff, like favorite color, but I need the user's ID. Using makeRequest works in general, but I need to send the account name, or a hash of it, or any sort of identifier to my server so it gets the right data. What's the easiest way to get that info? Currently it asks the user via HTML form, every single time it loads, which is pretty lame.
I've been looking at OAuth stuff, trying examples, and nothing works... I got an OAuth client key but don't know how/where to use it (or if I do use it with a Gadget). I found the Calendar feed/scope URI but I'm not really sure if that's correct to just get a user identifier, maybe I should use accounts. Half the examples are for OAuth 1.0...it's really frustrating.
Does anyone know a way to do this, or a good example/tutorial that explains how, for a Gadget? I think Gadgets are different since they run on Google's servers...but don't really know how this makes them different in this context.
See the answer to this: osapi.people.get() returns 404 in google calendar sidebar gadget. Then associate the google user ID with your internal ID, if different.

Resources