Jira Service Desk Api not working with Basic Authentication

Neha Sachan June 11, 2021

I want to integrate JSD (Jira Service Desk ) Rest Apis to my code.

Where I want to

  1. create customer,
  2. create organisation 
  3. add them to organisation and couple of more thing....needed to perform

 

I want to call JSD Rest Api's using Basic Authentication which required email:api_token

 

I passed all the information but still its that same message - 

`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
`

 

Please let me know how to fix it.

 

My CURL Call:

curl --location --request POST 'https://xxxxx.atlassian.net/rest/servicedeskapi/customer' \--header 'Accept: application/json' \--header 'Content-Type: application/json' \--header 'Authorization: Basic xxxxx==' \--header 'Cookie: atlassian.xsrf.token=xxxxx' \--data-raw '{ "email": "xxxx.xxxxxx@xxxxxxxxxx.com", "fullName": "Fred F. User"}'

 

1 answer

0 votes
Angélica Luz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 14, 2021

Hello @Neha Sachan,

Welcome to Atlassian Community!

When it comes to authentication for Jira Service Management Cloud API, it uses the same authentication method as Jira Cloud as mentioned in the documentation below:

Here in Community, we help mostly with the basics of API, since there is a specific Community for development questions.

I tested the endpoints you mentioned and it works when using email address + API token (created in https://id.atlassian.com/manage-profile/security/api-tokens).

//create customer
curl --request POST \
--url 'https://domain.atlassian.net/rest/servicedeskapi/customer' \
--user 'user@domain.com:TOKEN' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"displayName": "Fred F. User",
"email": "fred@example.com"
}'

//create organization
curl --request POST \
--url 'https://domain.atlassian.net/rest/servicedeskapi/organization' \
--user 'user@domain.com:TOKEN' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"name": "Charlie Cakes Franchises"
}'


//add customer to organization
curl --request POST \
--url 'https://domain.atlassian.net/rest/servicedeskapi/organization/ORG-ID/user' \
--user 'user@domain.com:TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"accountIds": [
"qm:a6671b47-cde7-4f90-g405-14356hijk417:25lm81no-320p-4qr7-st8u-9v7w2x87y223"
],
"usernames": []
}'

Since your question is related to development, if the documentation I mentioned doesn’t help, please, reach out to our developer community at https://community.developer.atlassian.com/.

Kind regards,
Angélica

Suggest an answer

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

Atlassian Community Events