Upload vimeo video with Laravel 8.x - laravel

I am testing vimeo with vimeo basic account and Laravel 8.x / guzzle in order to pay for a pro licence.
I am trying to implement a form-based video upload approch. According to the documents available to vimeo website, the first step consists in sending a post request to /me/videos then i will receive a response that will contain an HTML form in the upload.form field. Yet, the request status code is correct (201 : created).
My issue is that i don't see this field (upload.form) in the api server response (i have made a dd($response)).
Here is the code in my controller:
$response = Http::withToken('xxxxxxx')->withHeaders([
'Content-Type'=>'application/json',
'Accept'=>'application/vnd.vimeo.*+json;version=3.4'
])->post('https://api.vimeo.com/me/videos', [
'upload'=>[
'size'=>$request->file->getsize(),
'approch'=>'post',
]
]);
Can a person help me solve this problem?
The link of the documentation i have read is: Working with Video Uploads and other API references.
I really need your help please

Thank you for all.
I have tried the same request with postman and it has allowed me to understand that the instruction dd($response) does not give me all the informations contained in the server's response but just some informations in the headers.
To see what i wanted i have used one of these instructions:
dd($response->body());
// or
dd($response->json())
For example to obtain the HTML form provided by vimeo API, i have to use this instruction:
$response->json()['upload']['form'];
So i consider closed, this ticket.

Related

How to download drive files through HTTP requests with the access_token included in the url?

Can someone please help me on finding a way to send an HTTP request to Google Drive to download a file with the access token included in the url?
I searched a lot in the internet and found only this way to send an access_token in URL:
"https://www.googleapis.com/drive/v3/files/[fileID]?access_token=ya29.a0AfH6SMA4FU********&key=[apiKey]"
As you know, it only returns the metadata of the file because it does not contain alt=media. If you add "alt=meida" to the url, it fails to load and returns nothing.
It can be easily fixed with passing the access_token as a header. However, I cannot do that because I am using the url as a "src" of HTML and as a source for video segments in .m3u8 file.
Any suggestion?
Since January 1st, 2020, the Google Drive API doesn't support the access_token query parameter anymore.
See https://cloud.google.com/blog/products/application-development/upcoming-changes-to-the-google-drive-api-and-google-picker-api for the announcement.
This change only applies to requests with ?alt=media by the way. Unfortunately that's precisely the kind of requests that you're using...
I'm afraid there's no solution in your case.

Unable to discover devices in smartThings

I am developing an IOT device using smartThings.I am using aws lambda function for getting request and sending responses to the smartThings. I am getting request whenever smartThings app hitting lambda function and sending exact response to that request but still the discover devices are not showing in the smartThings app. Please help me
Refrence link:
https://smartthings.developer.samsung.com/docs/guides/smartthings-schema/smartthings-schema-reference.html#Interaction-types
the first image is the request that i am getting
2nd and 3rd images are the responses that i am getting according to the request
By choosing the correct deviceHandlerType in response the devices started discovering. i.e., "deviceHandlerType": "c2c-rgbw-color-bulb" (reference link for implementing schema for smartThings https://smartthings.developer.samsung.com/develop/guides/smartthings-schema/implement-schema.html)
we can choose deviceHandlerType based on our requirement.

Stocktwits request for Access Token returns a blank page

I'm following the instructions given on this page:
https://stocktwits.com/developers/docs/authentication
I've managed to get the client id, client secret and the code without any problems (up to step 4). However, when trying to exchange these for an access token, I'm getting a blank page.
The instructions specify that the return is a json format response - maybe there are some browser settings that I need to check to allow this?
thanks in advance for any pointers.
Judging by the title of this post "returning a blank page" it sounds like you are trying to make this request through the browser. The page you referenced says that the request must be a POST request and browsers cannot make POST requests.
On the step you're stuck on (step 5) there is a link that says "View the token call" that links here https://stocktwits.com/developers/docs/api#oauth-token-docs which shows how to make this POST request using curl.

Retrieve JSON response when creating video on Brightcove

I followed the example on http://docs.brightcove.com/en/video-cloud/media/references/reference.html#Video. The response gets shown in an iframe. However, I would like to be able to get the JSON response in order to store the data (i.e., Brightcove video ID) in my own database. I tried using AJAX post but Brightcove doesn't seem to accept post requests from a different origin. Is there a way to simply get the response data without displaying it in an iframe or in a separate window?
You can't get the response data in javascript since the API response does not include CORS headers. You'd need to do this in server-side code, which also has the advantage of not exposing your API token to the browser.

what is the facebook ajax request which get the posts?

I am trying using facebook from Scrapy.
I can log in successfully. However, I can't get the posts on facebook because the posts comes from ajax calls.
I tried using firebug and check the XHR. I got this:
I tried to check the response of all those request but none of them contains the actual data of the posts.
What is the ajax request that get the posts on facebook?
Thanks in advance
Don't use the AJAX calls from your browser. Those are encrypted since Facebook uses HTTPS connections. Focus on using their API to make the calls you need to get the data you want. That's the entire purpose of their Graph API.

Resources