Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

REST API curl example

steveshourds September 21, 2020

Trying for the first time to do rest api using curl.

curl -u "srs@perfectionsoftware.com:XXXXXX" -H "Content-Type: application/json" "https://perfectionsoftware.atlassian.net/rest/servicedeskapi/organization"

getting this response:

Basic authentication with passwords is deprecated. For more information, see: https://confluence.atlassian.com/cloud/deprecation-of-basic-authentication-with-passwords-for-jira-and-confluence-apis-972355348.html

The link is not very helpful, and everything I tried with api searching is very confusing.

I created an admin organization ID and API key in my administration settings but have no idea what to do with it?

2 answers

1 accepted

4 votes
Answer accepted
Angélica Luz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 22, 2020

Hello @steveshourds,

Thank you for reaching out to Atlassian Community!

Just for us to better understand and help you with this issue, I would like to know more details about the endpoint you are using.

I see that you created an API Key on admin.atlassian.com and that's is correct if you want to use the APIs from the documentation below:

Here is an example of the curl using the API key:

curl --request GET \
  --url 'https://api.atlassian.com/admin/v1/orgs/{Org ID}' \
  --header 'Authorization: Bearer 0a1bCdeFGhiJKLMNOPqR' \
  --header 'Accept: application/json'

If you want to use API for Service Desk Organizations, that is different from the above, then the API Token that you need to use is the one generated on your profile on https://id.atlassian.com/manage-profile/security.

  curl --request GET \
  --url 'https://domain.atlassian.net/rest/servicedeskapi/organization' \
  --user 'email@domain.com:A1b2345CdEfgHIJkLMn67O8P' \
  --header 'Accept: application/json'

Please, give it a try and let us know how it goes.

Regards,
Angélica

0 votes
Warren
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 22, 2020

Hi @steveshourds 

I don't use ServiceDesk, only Jira Software, but I think the concept is the same.

To use the API, you need to create an API token and then you use the combination of the email address and token. This needs to be 64-bit encoded before passing it to the API.

NayakS December 10, 2021

Is there any rest api available to commit a file into a repository. seems like no rest  post available for bit bucket server but we have found in bitbucket cloud, but unfortunately we dont have bitbucket cloud.

 

Any suggestion will be helpfull 

NayakS December 11, 2021

Hi @steveshourds

 

We are calling one rest put  to create a resource/file in repository  and working awesome in post man but from application we are getting 500 error from server.

Any suggestion will be helpfull.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events