Synology FileStation API - api

Hi I am trying to synology api to download a file, it seems that the API documentation is outdated,
I successfuly login and logut using the API,
but when I tried to use this api call
http://myds.com:5000/webapi/entry.cgi?api=SYNO.FileStation.Info&version=1&method=getinfo
the response sends error 103, "Method do not exists".
According with the documentation, first, you have to retrive the cgi path,in my case is "entry.cgi".
then you know that part of the api direction
/webapi/?api=&version=&method=[&][&_sid=]
According with the error 103 the (in this case is getinfo) doesn't exists, but the documentation tells other thing.. and it's driving me crazy
https://global.download.synology.com/download/Document/Software/DeveloperGuide/Package/FileStation/All/enu/Synology_File_Station_API_Guide.pdf
Someone has used Synology api recently? I need to figure out how to use the SYNO.FileStation.Download api call.

I'm afraid you will need to look into the code of the filestation php files.
Here are some impressions of how this was done for the PhotoStation:
https://gist.github.com/anthonydahanne/4583444
https://blog.jbowen.dev/synology/photostation/getting-started/get-api-info/
Similar to PhotoStation I would first search for the info-method to check what the API is supposed to offer.

I just happened to come across your thread, have you tried viewing the APIs available on your Diskstation? You can do that by calling
http://<YourDiskstationURL:Port>/webapi/query.cgi?api=SYNO.API.Info&version=1&method=query&quer%20y=all
I have a function that looks like the successor to the download function:
{"maxVersion":2,"minVersion":1,"path":"entry.cgi","requestFormat":"JSON"}
,"SYNO.FileStation.Download":
In the API-documentation Synology suggests to check whether a specific API is available or if it has changed.

Related

Dropbox getTemporaryLinks API errors description

I received an email from Dropbox states from middle of october get temporary links api will returns an email_not_verified error in case user not verified her email address, so far so good.
I'm able to get the response body from the doc https://www.dropbox.com/developers/documentation/http/documentation#files-get_temporary_link
Since I'm using dropbox java sdk and I'm used to code test first, I was trying to simulate the scenario, but having the json inside the http response, I've an error parsing the json inside dbx library. So I tried changing the status code and, having 409 I got com.dropbox.core.v2.files.GetTemporaryLinkErrorException: Exception in 2/files/get_temporary_link: "other"
but it is not enough, since I need to manage the scenario.. Can someone help me understanding what I can check in the code but first of all, what is the response I've to simulate in my unit test?
Thanks in advance
The other error case indicates that it's an error that the SDK you're using does not recognize. The GetTemporaryLinkError.email_not_verified error is relatively new, so you'll need to make sure you're using a recent enough version of the SDK to be able to identify it. For the GetTemporaryLinkError.email_not_verified error, that is v3.1.0 or later of the Dropbox Java SDK. (It's best to just get the latest anyway, which is currently v3.1.1.)
If you're are using an updated version of the SDK, it's also possible you're just not setting valid JSON for the GetTemporaryLinkError.email_not_verified error case when you're trying to simulate this. You can find the valid JSON for this error case in the /2/files/get_temporary_link documentation. Make sure you copy that as shown there if you're trying to simulate this.
Lastly, to actually catch that error with the Dropbox Java SDK, you'll want to catch GetTemporaryLinkErrorException thrown by getTemporaryLink. To check for the specific case, check the GetTemporaryLinkErrorException.errorValue. The GetTemporaryLinkError.isEmailNotVerified will return true for the unverified email case.

Kucoin Exchange Kline Get API Response is wrong

hey guys does somebody know why i dont get the correct response from thhis api call:
https://api.kucoin.com/v1/open/kline?symbol=LTC-BTC&type=1hour&from=1517446866&to=1518311025&limit=1000
it should give me normaly a couple of candelstick data back
i have code already for other exchanges with her api and did not have problems
but this one i dont know if i make somethink wrong or maybe the api from this exchange have a error
the documentation site is this: https://kucoinapidocs.docs.apiary.io/#reference/0/market/get-kline-data(open)
You are using an outdated API.
KuCoin switched to TradingView as its chart software. This is why you have https://www.kucoin.com/#/trade.pro/LTC-BTC as the default view for trading. You can still access the old view via https://www.kucoin.com/#/trade/LTC-BTC.
Looks like the API call you are using was made for the old version.
Use this URL instead:
https://api.kucoin.com/v1/open/chart/history
Working URL:
https://api.kucoin.com/v1/open/chart/history?symbol=LTC-BTC&type=1hour&from=1517446866&to=1518311025&limit=1000
For more information about the new API call: (notice how it says tradingview-version!)
https://kucoinapidocs.docs.apiary.io/#reference/0/market/get-kline-data(open,-tradingview-version)

Endpoint with Google Flex env

There is bit of a confusion, wondering if somebody can help me with this.
Here is an example which is a year old and uses goapp with polymer and endpoint
https://github.com/googlesamples/cloud-polymer-go
Here is a recent example using gcloud
https://github.com/GoogleCloudPlatform/golang-samples/tree/master/appengine_flexible/endpoints
Both are different as google changed its approach.
As per second example, I am able to create endpoint functions which uses json for input and output. However there are 2 problems
1st. It is throwing error if I put functions in different file under same package. It works when I run go run .go. but then I dont understand how app.yaml come into picture. I think this url /_ah/spi/. should work
2nd. I am using postman app to check the request and response from endpoint. Is there a better way? I thought google does provide a platform to test endpoint.
Is there any example which implements examples similar to 1st one with new libraries?
looking forward for your help. Thanks.

Accessing Metacritic API and/or Scraping

Does anybody know where documentation for the Metacritic api is/if it still works. There used to be a Metacritic API at https://market.mashape.com/byroredux/metacritic-v2#get-user-details which disappeared today.
Otherwise I'm trying to scrape the site myself but keeping getting a blocked by a 429 Slow down. I got data like 3 times this hour and haven't been able to get anymore in the last 20 minutes which is making testing difficult and application possibly useless. Please let me know if there's anything else I can be doing to scape I don't know about.
I was using that API as well for an app I wrote a while ago. Looks like the creator removed it from Mashape. I just sent him an email to ask whether it'll be back up. I did find this scraper online. It only has a few endpoints but following the examples given you could easily add more. Let me know if you make any progress!
Edit: Looks like CBS requested it to be taken down. The ToS prohibits scraping:
[…] you agree not to do the following, or assist others to do the following:
Engage in unauthorized spidering, “scraping,” data mining or harvesting of Content, or use any other unauthorized automated means to gather data from or about the Services;
Though I was hoping for a Javascript way of doing this, the creator of the API also told me some info.
He says I was getting blocked for not having a User agent in the header and should use a 429 handling procedure i.e. re-request with longer pauses in between.
A PHP plugin available as well: http://datalinx.io/shop/metacritic-api/
I had to add a user agent like JCDJulian said and now it allows me to scrape. So for Ruby:
agent = Mechanize.new
agent.user_agent_alias = "Mac Firefox"
Then it stopped giving me the 403 Forbidden error.

Using Google maps API via SSL

So, I know just recently that google maps API is now available in SSL (here).
My question is, how do I retro-fit my http google maps api script to use this?
So my http Google maps API script call looks like this:
http://maps.google.com/maps?file=api&v=3&sensor=false&key=########
They suggest via this link that to use SSL it should be this:
https://maps-api-ssl.google.com/maps/api/js?v=3&sensor=false
I've tried retro-fitting this into my old URL format like so:
https://maps-api-ssl.google.com/maps/api/js?v=3&sensor=false&key=########
but that no longer displays the map.
Does anyone have any suggestions on what the URL should be?
Thanks
Try this line:
https://maps.google.com/maps/api/js?v=3.5&sensor=true
Google btw suggests that you explicitly enter what version of the api you are going to use. Just entering v=3 will always return the latest version, at the moment 3.5. I believe that the current stable version is 3.3.
As Trott wrote in his answer, api key is no longer needed.
You don't need an API key to use v3, but I suppose it probably doesn't hurt. General things to try:
Open your browser's JavaScript console and see if it is reporting any problems when you load the page.
Remove the API key
Change & to just &
Copy and paste the exact link text you put above into your code, because that link text is working for me. I'm referring to this:
https://maps-api-ssl.google.com/maps/api/js?v=3&sensor=false&key=########
Of course, change ######## to your API key (or just remove it altogether).