Resolve a JIRA ISSUE using REST API in java - jira-rest-api

A backend API generates JIRA-ISSUE ID.
How do I close the jira ticket through REST API calls?
Can somebody help me as to how to proceed with this?
What are the requirements and steps to follow?

first list the next transition id
https://yourServer/rest/api/3/issue/FOO-123/transitions?expand=transitions.fields
and then use your transition id (212) to update
curl -u $JIRA_TOKEN -X POST --data '{ "transition": {"id": "212"} }' -H "Content-Type: application/json" https://yourServer/rest/api/3/issue/FOO-123/transitions?expand=transitions.fields

Related

Hitting the GitHub api for listing PR comments returns no result

I want to list (count actually) the comments made on a GitHub pull request.
As per the documentation, I am using the following curl command to hit the GitHub API
curl -H "Accept: application/vnd.github+json" -H "Authorization: token abcdefg123457" https://api.github.com/repos/MyOrg/MyRepo/pulls/2/comments
The result is the following:
[
]
despite me seeing comments on #PR2.
What am I missing?

dremio list user API

I'm trying to query dremio using the documented API to get list of users.
Dremio version:
Build
20.2.2-202203241726030461-f7eea3e0
Edition
Enterprise Edition
API:
https://docs.dremio.com/software/rest-api/user/list-users/
sample query:
curl -X GET --location "http://localhost:9047/api/v3/user" \
-H "Authorization: _dremiohrr395nv31g8k610616tucp91g" \
-H "Content-Type: application/json" \
-H "Accept: application/json"
I keep getting this error:
{
"errorMessage": "Something went wrong. Please check the log file for details, see https://docs.dremio.com/advanced-administration/log-files.html",
"moreInfo": "HTTP 405 Method Not Allowed"
}
It seems that this API is not supported at all.
Is there a published API to list all users so that I can get user name, uid, and role memberships?
I'm trying to avoid using SQL query.
v3 list users API is buggy.
user apiv2/user works

Angular 5 - How to fetch data using curl and display it?

Hey Guys I'm new to Angular, can somebody help me how to fetch the data and display it in a component with the following details, just a format will help me.
curl -X GET -H "Content-Type: application/json" -H "Authorization:
Token a41d2b39e3b47412504509bb5a1b66498fb1f43a" -H "Cache-Control:
no-cache" "https://api.mywebsite.co.in/v1/mf/?key=118656INF204K01E05"
Thanks in Advance.
if you want get the full response from the api you need to use HttpClient module.
getting full response from api Working example Check this:https://stackblitz.com/edit/angular-64qrhq?file=app%2Fdata.service.ts

404 Error From OAuth Token URL

using this URL as a reference and attempting token exchange with client ID and secret:
https://developers.onelogin.com/api-docs/1/oauth20-tokens/generate-tokens
I get a 404 error for the URL provided. I'm using:
https://api.us.onelogin.com/auth/oauth2/token
Am I missing something from the docs? Thanks!
The API is working for me. Just curious - are you using the POST method?
Have you tried the CURL example at the bottom of the doc page?
Just to be clear, you need to sub in your shard, which is prob us.
Like
curl -X POST -H "Authorization: client_id:{enteryours}, client_secret:{enteryours}" -H "Content-Type: application/json" -d '{ "grant_type":"client_credentials" }' 'https://api.us.onelogin.com/auth/oauth2/token'

Pushbullet API from cURL - invalid request

I'm working on an app using Pushbullet's API, but I'm running into odd errors when running through the sample code at https://docs.pushbullet.com/v2/pushes/.
I'm executing the following cURL command (in Windows):
curl -k -u <MY_API_KEY>: -X POST https://api.pushbullet.com/v2/pushes --header 'Content-Type: application/json' --data-binary '{"type": "note", "title": "Note Title", "body": "Note Body"}'
...but it keeps generating the following error:
{"error": {"type":"invalid_request","message":"The param 'type' has an invalid value.","param":"type","cat":"\u003e:3"}}
It also produces this error:
The other commands for the other endpoints in the documentation work fine...it's just this one.
Got any suggestions? Thanks for the help! :)
It looks like windows doesn't support those kinds of quotes on the command line. Here's an example that works:
curl https://api.pushbullet.com/v2/pushes -X POST -u <access token>: --header "Content-Type: application/json" --data-binary "{\"type\": \"note\", \"title\":\"Note Title\", \"body\": \"Note Body\"}"
I think I'm going to try to replace the curl examples with something that has less confusing behavior.
I figured it out - I don't really know why, but the cURL command wasn't working through the DOS prompt, and also wasn't working using the Postman REST client for Chrome, but I got it working in the DHC extension for Chrome. The trick was setting the Authorization header to "Basic", which resolves the Pushbullet access token to some other form, and makes a successful the HTTP request.
Hope this helps someone down the road if they run into this on Windows!