How to get a git tag message from the Github API - api

I'm trying to get tag messages from the Github API. It says here I'm supposed to use this URL:
https://api.github.com/repos/octocat/Hello-World/git/tags/940bd336248efae0f9ee5bc7b2d5c985887b16ac
But I get "Not found" there, even if I try my own repo:
https://api.github.com/repos/richbrat/testrepo/git/tags/6cec7db2ae2d0213644480ba58bcc4a277ae8a2b
I'm using the node-github package with an oauth token and it's working really well for the "repos" calls but "gitdata" doesn't seem to work. Checking the headers I get back gives me a hint though:
... "x-oauth-scopes":"user, public_repo, repo, gist","x-accepted-oauth-scopes":"repo" ...
Gitdata seems to be outside my scope. Is it possible to get it into my scope or is there another solution to get tag messages?

Related

Unable to use the Dialogflow CX REST API

When testing the dialogflow API on postman, I am getting a 404 error even though I have specified the correct URL while providing the correct parameters for the parent values. Authentication is also validated.
Any help would be appreciated.
For references, here's where I tried to retrieve list of environments from my agent Heres a pic of the problem. I have provided variables for the ID values
I am getting the same error for most of the endpoint values. It is however working on the detectIntent one
Nevermind, I got my mistake. I didnt remove the '{parent=}' from the URL, apparantly the curly brackets are part of google's naming convention.

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.

How to get the list of all the issues in a project in JIRA using REST API?

I am trying to get the list of all the issues irrespective of their status in a JIRA project.
I am doing a GET requset to the following URL:
https://jira.org.com/rest/api/2/search?jql=project={projectID}&issuetype=all
But, this doesn't return all the issues in response.
Where am I going wrong? Is the URL format above wrong?

Jira V6.0+ creating a project over REST API

I've got a problem: I'm working on an external webinterface for my company and we use Atlassians JIRA as a project issue and tracking method. I am trying to connect our webinterface over the REST API. After a short research I found out, that Atlassian never implemented the possibility to create a new JIRA Project over their REST API. Well, that isn't that true, they've implemented it in the actual version (7.0) because they migrated their other two APIs to one REST API. Now comes my problem: We are currently unable to upgrade from version 6.4.4 to version 7.0.0. After a second search I found a workaround for this problem. You can find it here:
The real problem is that this workaround isn't working or I'm doing it wrong.
I've already tried it with a GET request and the given arguments as parameters and over the normal POST method with a JSON body in it.
What's my problem?
Here some more informations: When I try it over GET, I always receive the normal response for the URL (it returns a list with all available templates). When I try it over POST with a JSON body (this is by the way the normal method for the normal functions of the REST API) I get back a HTTP-Error 415 Unsupported media type.
it would be nice if someone could test this workaround with a 6.0+ version of JIRA
So after some months I got it by myself. You have to make a POST request with the following header fields:
Content-Type=application/x-www-form-urlencoded; charset=UTF-8
Authorization=Basic {set your credentials as a Base64-String: "user:password"}
X-Atlassian-Token=nocheck
Once done you can set your POST-Parameters to the following:
name=Name of the Project
key=Key of the Project
lead=Leader of the Project
keyEdited=true (don't change it!)
projectTemplateWebItemKey=com.atlassian.jira-legacy-project-templates:jira-blank-item (don't change it!)
projectTemplateModuleKey=com.atlassian.jira-legacy-project-templates:jira-blank-item (don't change it!)
Hope that this helps someone, Jira is just weird in some cases :/

Foursquare users/self/checkins API Deprecated

I'm building an application that uses the Foursquare API and I'm trying to get a list of recent checkins for the authenticated user. Other parts of the API are working just fine, but when I make a get request for the below URL, it returns a deprecation error message followed by a bunch of results that seem to ignore the afterTimestamp param.
https://api.foursquare.com/v2/users/self/checkins?afterTimestamp=1358127640&v=20130113
The error message:
Please provide an API version to avoid future errors.See http://bit.ly/vywCav
The same exact URL works perfectly fine when I use it via their API explorer.
Any ideas?
EDIT:
The deprecation error is actually happening on all requests, even though I'm including the "v" paramater that they mention in the link.
Your URL is malformed. The first occurrence of & should be replaced with a ?.