Flattr API v2: Get a user - flattr

shouldn't this get-request return a valid JSON result?
https://api.flattr.com/rest/v2/users/:der_michael
If I open this in my browser I get
{"error":"not_found","error_description":"The requested user could not be found","error_uri":"http:\/\/developers.flattr.net\/v2\/#user"}
According to the current documentation # http://developers.flattr.net/v2/#resources this should be a sufficient request, shouldn't it?

The request is almost correct. There is only a colon ( : ) to much.
https://api.flattr.com/rest/v2/users/der_michael
Good luck!

Related

Github Enterprise Raw URL Gist Unable to Download

I'm able to get a list of gists and their files https://api.git.mygithub.net/users/myuser/gists?per_page=100&page=1 which I found using the docs here: https://docs.github.com/en/free-pro-team#latest/rest/reference/gists#get-a-gist
The files on the gist object have a raw_url. If I fetch the raw_url with the same token, it fails wanting me to authenticate. If I add the header: Accept: application/vnd.github.v3.raw it returns a 406 Not Acceptable. I've references to that header around.
I'm not sure what the scope should be on the token. It seems like it would be the same one I accessed the API. In the UI if you click the raw file it gets a token appended to the url. That token doesn't look like one of the Private tokens mentioned here: https://docs.github.com/en/free-pro-team#latest/github/authenticating-to-github/creating-a-personal-access-token
So what is the format of the HTTP request to download the raw gist?
The raw url needs to have the hostname of gist. changed to raw. and the url path needs to start with /gist/.
Example code in Go fixing it:
url := gistFile.RawUrl
url = strings.Replace(url, "gist.", "raw.", 1)
url = strings.Replace(url, ".net/", ".net/gist/", 1)

Invoking GET statuses/user_timeline with user_id='' seems to invoke GET statuses/home_timeline. Why?

As I was trying to harvest the user_timelines for a list of user_ids, I noticed that my own home_timeline was also being harvested. In the end I discovered that whenever my list used a null string entry for user_id, executing the code below was the same as executing
twitter_api.statuses.home_timeline. That is ok, but I do not see such behavior Twitter- documented? What am I missing in the documentation?
auth = twitter.oauth.OAuth(OAUTH_TOKEN, OAUTH_TOKEN_SECRET,CONSUMER_KEY, CONSUMER_SECRET)
twitter_api = twitter.Twitter(auth=auth)
twitter_api.statuses.user_timeline(user_id='')
You're correct - if you invoke the Twitter API v1.1 user_timeline method without a user_id or screen_name parameter specified (or null), it will return the user_timeline for the authenticated user making the API call. This is undocumented behaviour.
Note that home_timeline is a different method, and will return Tweets from the users you follow, not your own Tweets. I think you're describing the former (user_timeline), not home_timeline.
I'll make a note to get this added to the official API documentation.

how does the departure criteria work for waypoint sequence API

below is the here waypoint sequence api structure i am trying to execute
https://wse.api.here.com/2/findsequence.json?start=kalwa-thane&destination1=goregaon-mumbai&destination2=andheri-mumbai&destination3=kurla-mumbai&destination4=wadala-mumbai&destination5=prabhadevi-mumbai&end=ghodbandar-road-thane&mode=fastest;car;traffic:enabled&departure=2019-12-05T17:30:00+08:00&improveFor=time&app_id={app-id}&app_code={app-code}
however getting below response
{"results":null,"errors":["Bad Format for Date and Time: 2019-12-05T01:30:00. Error ID: f9f62c75-93da-47c8-a244-81be2140ac01"],"processingTimeDesc":null,"responseCode":"400","warnings":null,"requestId":null}
How to get the output with correct response
Could you please try the below request format.
https://wse.api.here.com/2/findsequence.json?start=kalwa-thane;19.20484, 73.00359&destination1=goregaon-mumbai;19.16153, 72.85618&destination2=andheri-mumbai;19.10393, 72.86698&destination3=kurla-mumbai;19.0633, 72.88502&destination4=wadala-mumbai;19.01516, 72.86378&destination5=prabhadevi-mumbai;19.01637, 72.82897&end=ghodbandar-road-thane;19.21895, 72.97815&improveFor=time&app_id=APP_ID&app_code=APP_CODE&departure=2019-12-05T16:02:45Z&mode=fastest;car;traffic:enabled
See the documentation for more details.
Hope this helps!
The '+' symbol in the URL needs to be encoded as '%2b' as per https://www.w3schools.com/tags/ref_urlencode.asp
The HERE Developer Support documentation link shows this in action.

How to add parameters to API calls?

I'm using CareerBuilder's API:
http://api.careerbuilder.com/Search/jobsearch/jobsearchinfo.aspx
In the description, the endpoint is:
http://api.careerbuilder.com/v1/jobsearch
As the developer key is necessary, I assume that the key should insert after v1 with a ?, as follows:
http://api.careerbuilder.com/v1?DeveloperKey=XXXXXXXXXXXXXXXX/jobsearch
Then, if I put this into a browser, it should return me the XML as the output.
When I have done this, the page gave me 404 errors.
How does this type of API works? I assume it works like Google APIs
I eventually solve this by adding parameters at the end of the endpoint URL...
http://api.careerbuilder.com/v1/jobsearch?DeveloperKey=XXXXXXXXXXXXXXXX&ID=YYYYY

Astrid request returning empty

I'm trying to use the http://Astrid.com API, specifically to get data using the method under the "Request Format" section on this page - http://astrid.com/apidoc/file.README.html
The URL I built is:
https://astrid.com/api/7/task_list?app_id=[MY APP ID]&time=1&user_id=[MY USER ID]&sig=[MY REQUEST SIGNATURE]
And it returns this:
{"list":[],"time":1363131562,"status":"success"}
Seems like it worked, but does anyone know why the "list" array might be returning empty? I've created a bunch of tasks in my profile so it should be showing those.
Thanks!
You need to sign in first with the method user_signin. If successful you get a token.
Then you need to call the task_list method providing the token.
You do not need to provide a user id with the task_list method. It is only used to select tasks that you share with this user.
Example for signing in:
https://astrid.com/api/7/user_signin?provider=password&app_id=YOUR_APP_ID&secret=YOUR_ASTRID_PASSWORD&sig=SIGNATURE&time=1365715302.36&email=YOUR_EMAIL
Example for getting your tasks:
https://astrid.com/api/7/task_list?active=true&token=THE_TOKEN&sig=SIGNATURE&app_id=YOUR_APP_ID&time=1365715304.41