Missed Team ’24? Catch up on announcements here.

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

Knowledge Base REST API Query Examples

Hey everyone!

The purpose of this Community article is to provide a couple example queries for using this experimental API with both cURL and Postman, which is in reference to the KB API Developer Document here: The Jira Service Management Cloud REST API

 

Note that the method to run these queries may change over time as this is an experimental API.

cURL

First you will need to authenticate yourself, which will require an Access Token

Afterward you can use a command similar to the following in the terminal:

curl -v https:/mysite.atlassian.net --user myaddress@email.com:<accesstoken>

Once you are authenticated using your access token you will then need a Base64 encoded version of your username and password for the GET request. This can be completed using a Base64 encoding tool, such as: Base64 Encode and Decode - Online

Once you have this, your cURL command should look like the following:

curl --request GET \
        --header 'X-ExperimentalApi: opt-in'\
        --header 'Authorization: Basic base64encodedusernameandaccesstoken' \
        --header 'Accept: application/json'

And the results should look similar to the screenshot below:

06c642f1-0eb3-4b26-97f4-4371c2f93e68.png

Postman

First you will need to authenticate yourself using Basic auth, which will require your Username (email address) and your Password (which will be your access token):

17d78a9d-084f-4535-86c7-878edf767853.png

Afterward, you can bill the GET request in Postman.

  1. First, the URL should look similar to the following: https://mysiteatlassian.net/rest/servicedeskapi/knowledgebase/article?query=article'

  2. As this is an experimental API the headers should have a KEY of X-ExperimentalAPI and a VALUE of opt-in

  3. After these two things have been setup you should receive a response similar to the following:

2999c7fb-9bb9-4ef3-95f1-2fd2c72bfa56.png

It's important to note that the Knowledge Base API uses Basic Authentication, adding ?query=article to the GET URL and using X-ExperimentalApi: opt-in within the headers is necessary for these queries to run successfully.

Thanks for reading!

Cheers,

Christian

1 comment

KrishnaMohan June 8, 2023

Thanks for the informative post.

I am looking for the same to POST the data using graphql mutation. Do you have any thing, please redirect to me.

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events