How to get external player URL from the Vimeo API? - vimeo-api

I' trying to get the external player URL from the Vimeo API (URL like this: https://player.vimeo.com/external/233547548.sd.mp4?s=d2dd296b3c068378ea3f544042c92ce2f803a62b&profile_id=222). I have a business account and I'm trying to get those URL for my own videos. If I do a GET https://api.vimeo.com/videos/233547548 I can't find the external player URLs in the JSON data.
What I'm doing wrong?

As answered by #Tommy Penner in the comments, you need to use an authorization token that have the video_files scope and be authenticated to the video owner.
The Vimeo API documentation is a bit light on the subject but the relevant info is here: https://developer.vimeo.com/api/authentication#understanding-the-auth-process
Thanks Tommy

Related

Retrieve data from Salesforce using Django

I am trying to integrate salesforce Rest API with Django, so for hours I have been trying to figure out the endpoint which it exposes, I have learned to create records but how do I access those records as the URL mentioned in docs is https://yourInstance.salesforce.com/services/data/v52.0/query/?q=SELECT+name+from+Account,
what is "yourinstance" here, any help will be appreciated, thanks in advance
when i tried to access above URL in thunder client it gave me this error
Couldn't resolve the hostname to an IP address, Verify Url: https://trial65.salesforce.com/services/data/v52.0/query/?q=SELECT+name+from+Account
Assuming that you have created a Connected App, generated the client id/secret, to get the Bearer Token.
In the response where you get your bearer token from Salesforce API refer this , it also provides you with instance URL as part of response.
{"id":"https://login.salesforce.com/id/00Dx0000000BV7z/005x00000012Q9P",
"issued_at":"1278448832702",
"instance_url":"https://yourInstance.salesforce.com/",
"signature":"0CmxinZir53Yex7nE0TD+zMpvIWYGb/bdJh6XfOH6EQ=",
"access_token":"00Dx0000000BV7z!AR8AQAxo9UfVkh8AlV0Gomt9Czx9LjHnSSpwBMmbRcgKFmxOtvxjTrKW19ye6PE3Ds1eQz3z8jr3W7_VbWmEu4Q8TVGSTHxs",
"token_type":"Bearer"}
Goto Set Up > MyDomain There you'll find the My Instance URL for your salesforce org.
Screen shot of MyDomain page for reference

Not able to load the Image from facebook response

I'm using Auth0 api for login. I have received facebook response in which user profile picture is as below:-
https://lookaside.facebook.com/platform/profilepic/?asid=1324218274262199&height=50&width=50&ext=1525319136&hash=AeSrHdLSZSZhBkyQ
But when I'm trying to refer this image as below, I'm not able to retrieve the image.
<img src="https://lookaside.facebook.com/platform/profilepic/?asid=1324218274262199&height=50&width=50&ext=1525319136&hash=AeSrHdLSZSZhBkyQ">
Any can give me any expert advice why its happening.? I'm not able to find any related docs.
You should use the image by calling the picture attribute from your user object. So for example, we can use the access_token we receive upon authentication to call the /userinfo endpoint to get the user profile (this information is returned as a JSON object) at which point we can do something like userProfile.picture. If you are still having trouble can you please share your code?

Media Builder Not Found Exception while Publishing into Instagram using Graph API

We are oftenly getting "Media Builder Not Found" Exception while publishing media using Instagram Graph API.Can anyone know how to fix it?
Triggered URL:
Url1 : https://graph.facebook.com/v2.10/<userId>/media?access_token=<token>&image_url=<imageUrl>
&caption=<caption>
Url2 : https://graph.facebook.com/v2.10/<userId>/media_publish?creation_id=<creationId>&access_token=<token>
Yeah, this is tricky and sad - Facebook really has outdone itself here. The issue is that uploading to Instagram using Facebook API requires 2 types of access tokens.
When you call /media endpoint to upload an image, a user access token must be used.
When you use /media_publish to publish a previously created image - you must use page access token
Good luck!
I had the same issue, in my case, using the page token to create the media object and then using the user token to publish it, solved it.
What's strange though is that before I got the Instagram permissions approved, everything worked just by using the page token...but after I got the permissions approved it started failing and I had to use the user/page token combination to make it work.

How to programmatically post like and comment an URL on facebook?

This is confusing. So just to clarify:
REQ #1: To fetch basic stats for a URL, you send GET request to:
http://graph.facebook.com/?ids=http://some.com
(alternatively, FQL can be used to fetch stats for a URL, but that doesn't return the OpenGraph Object)
REQ #2: To fetch comments for a URL, you do a GET:
http://graph.facebook.com/comments/?ids=http://some.com
REQ #3: To fetch likes for a URL, you GET:
http://graph.facebook.com/likes/?ids=http://some.com
But how do you comment on / like a URL programmatically?
I guess, likes can be created using Open Graph API, right?
https://graph.facebook.com/me/og.likes?object=1234
where 1234 is the OpenGraph Object ID of an article (as returned by REQ #1).
But this requires an approval process, the like action has to be approved by Facebook.
Is there a better way to do this? Can I use for example the Graph API for all these things?
My goal:
Currently I'm using the Facebook like button and comments plugin to create likes and comments. But these use the JS SDK, which is huge, and they generate a lot of external requests. I wanna get rid of them and just send an AJAX request to my server, which would then asynchronously talk to Facebook, and it would post the Like / Comment.
Is this possible?
Thanks in advance!
I read through the Facebook docs briefly and I don't believe you can do this other than the way you indicated with authenticating.
You should also take a look at this thread: 'Like' a page using Facebook Graph API
You would need to authorize every single user before he would be able to like something, and you would need to go through a review process on Facebook. And i am pretty sure you would not get the required permissions approved just because you want to get rid of the JavaScript SDK overhead, to be honest.
The Social Plugins are asynchronously, so the overhead for downloading the SDK is irrelevant as it happens in the background and it is non-blocking.
I have an idea, to do this. You can use long term access token, Once you login you receive short term token. After receiving short term token you need to request your long term access token. Save that token in DB or file.
Then you can use Graph Api, to make requests. This will eliminate the need for access requirement every time you request api.
Just use access token you saved before.
Refer this documentation from Facebook for further clarity.
https://developers.facebook.com/docs/facebook-login/access-tokens
Happy Coding!
Atul Jindal

How to Follow Twitter Users by API in Coldfusion?

Oauth is pretty complicated but I think I got the authentication working. I got up to the point where I get the user to authorize on Twitter and I have the access token and access token secret. From here, I'm not sure how I use it to generate a request to follow a user.
I know that the url is: http://api.twitter.com/1/friendships/create.xml and that you can either pass in a user_id or screen_name
but does anyone have any example code in Coldfusion that I can see as to how the cfhttp call looks like with all the parameters?
Thanks in advance.
Try (monkeh)Tweet Twitter API. It supports most of the twitter API methods including follow a user. Easy & freaking cool CF open source by Matt Gifford