Using the Vimeo API, how do I replace all videos in a Vimeo album? - vimeo-api

Using curl, I'm trying to create a working Vimeo API call that replaces the videos in a Vimeo album with a different set of videos. (The docs are here.) I am successfully deleting the existing videos from the album but my new video info seems to be invisible to Vimeo. Vimeo responds with a 201 ("created") instead of the 200 I'm looking for.
Here is my curl command (with subs for actual data):
curl -H "Authorization: bearer 123abc456def" -X PUT --data "videos=%2Fvideos%2F11111%2C%2Fvideos%2F22222%2C%2Fvideos%2F33333" "https://api.vimeo.com/me/albums/7777777/videos"
I don't know what I'm doing wrong and the Vimeo API docs & playground don't give me the answers I need. My questions and observations:
Should I be url encoding the new video URIs (e.g. 11111,22222, etc)? I have also tried without url encoding and it made no difference. But then the 201 might be telling me it didn't get as far as handling my replacement URIs.
a PUT is required for this operation. I have used PUT successfully to add a video to an existing album (in LiveCode, haven't tried it with curl)
I got the same results when I tried this PUT in LiveCode. I moved the request to curl because more people are familiar with curl.
This is my first rodeo using the Vimeo API. It's a great, vast resource and I've had no problems working with it until this. I'm just stuck on this item and really need it to work!
Thanks for any help you can offer.

This is an ancient, deprecated way of handling batch editing. I'm not sure how it still exists. We will move it to the proper batch creation standard in 3.4.
I think the existing system is supposed to be a comma separated list of video id's, so
curl -H "Authorization: bearer 123abc456def" -X PUT --data "videos=11111%2C22222%2C33333" "https://api.vimeo.com/me/albums/7777777/videos"
is likely the proper request.

Related

How can I Upload a feed via postman to Amazon Sp-API?

I've spent weeks, hours daily trying to figure out how to upload a feed (POST_FLAT_FILE_PRICEANDQUANTITYONLY_UPDATE_DATA) to Amazon sp API.
Before even attempting to do it in PHP, I want to 1st make it work on Postman.
I've been successful getting a FEED ID and a FEED URL (I Used content type: "text/xml; charset=UTF-8" since it's a flat file (CSV not XML).
Although, If I can make it work easier via XML I Would gladly switch. I just want to be able to update my inventory and price in same feed.
Are there are links to a postman configuration to upload to a feed?
I think I'm supposed to use "PUT" and upload to the Feed url but I can't find an already complete postman config for it.
Any help would be soooooooo appreciated.
Thank you so much!

CSRF Token error when attempting to post from CURL to an API endpoint I control. How do I write the request?

I have not utilized this part of Django before, but I have an endpoint which is giving me a 403 error and is telling me that my request needs a csrf token. I was trying to figure out how best to get this since I was attempting to set up a bunch of curl requests to handle some simple queries to the endpoint. Likewise, I was thinking to also use POSTman, but I was not sure where documentation is to handle these request.
I have seen the cookie csrftoken, but when I was attempting to curl with it, it was still giving me a 403. thought it would looking something like this:
curl -d #profilepicturev2.png -b "csrftoken=Ebfn2OlfhSwFjAEQdoQon7wUjbynFoJqrtHMNPla3cy7ZfCMT9cxZ3OQHsbaedam" http://127.0.0.1:8000/api/files/uploader
Maybe I am mistaken? I am trying to send a photo to the server, so i was thinking that this would be correct and wasnt sure if i needed to add additional params in order to append additional data information.
i need to see your code, but i think you need to install "pillow" to send pictures in django !

where can i get deep documentation of ArgoCD apis

I need to list all applications based on some label filters.
https://argocd_domain/api/v1/applications
in order to list all apps from argoCD API, I want to put all possible filters.
The Argo CD API is documented in its Swagger document.
Copy and paste that JSON to the Swagger Editor, and you'll get a nicely-formatted page describing the API. Here's the section for listing applications:
The function to handle a list-applications request calls ConvertSelectorToLabelsMap. Reading the implementation of that parsing function, you can find the expected format of the selector parameter.
At a glance, it seems the format is a comma-delimited list of key=value pairs.
Using the Swagger Editor, I generated the this test URL:
curl -X GET "https://editor.swagger.io/api/v1/applications?selector=label1%3Dvalue1%2Clabel2%3Dvalue2" -H "accept: application/json"
Looks like you'll need to URL-encode the equals signs and commas.
You can find the Swagger docs by setting the path to /swagger-ui in your Argo CD server address. E.g. http://localhost:8080/swagger-ui.
You can find a hosted version of Argo's Swagger UI on https://cd.apps.argoproj.io/swagger-ui

Yahoo finance webservice API direct to ?bypass=true

Refer to the Yahoo finance webservice API, I unable to find http://finance.yahoo.com/webservice/v1/symbols/YHOO,AAPL/quote?format=json&view=detail
It shows 'Not a valid parameter'.
I also discover it will direct to ?bypass=true
How can I view the json data?
My understanding is that json is only supported through Yahoo Query Language (yql) API. The API endpoint is http://query.yahooapis.com/v1/public/yql and you have to submit the query in the form as (prefixed with ?) q=select * from yahoo.finance.quotes where symbol in ('symbol1,symbol2'), you must also specify the format as format=json, you may also need to specify an environment in order for the data to be return correctly based on certain schema. So far I found env=store://datatables.org/alltableswithkeys works for me. The entire url of course has to be url-encoded, you can run a curl command to test it out (replace with actual stock symbol):
curl -G http://query.yahooapis.com/v1/public/yql? --data-urlencode "q=select * from yahoo.finance.quotes where symbol in ('symbol1, symbol2') --data-urlencode "format=json" --data-urlencode "env=store://datatables.org/alltableswithkeys"
For more information, please check YQL Guide. It took me hours of reading and try-and-error to make it work!

Firebug and AMF post

I have to debug a website that uses a swf to send amf posts to a flex2gateway.
In Firefox's "Firebug > Net" I see the POST url and when I click on it, the Post tab shows scrambled jiberish:
The response is also scrambled:
But the headers and cookies are not scrambled:
How can I unscramble the post so that I can create a curl with the proper post values. And how can I unscramble the response?
AMF is a binary format. As such Firebug and Chrome Dev Tools don't do a very good job of being able to read them. In the past, I have used a product called ServiceCapture to 'read' AMF messages. Charles is another product that can do this.