Intro to sending Backlog API requests

Here’s a basic introduction about using the Backlog API and sending requests to it.

Overview:

  1. Get your Backlog API key
  2. Compose the Backlog API path
  3. Use CURL with your API key to send to the API endpoint

1. Get your Backlog API key :key:

In order to use the Backlog API, you need to generate an API key in your Backlog space personal settings. See How to generate Backlog API key & its function

The key is for authentication when making requests to the Backlog API, and it allows you to access information related to your Backlog space.

For authentication, there’s also OAuth 2.0 and Access Token, but we will be using only API key in this post.

2. Compose the Backlog API endpoint

The URL endpoint is made up of two parts:
Backlog space domain + URL path for API request

:bulb: Note that the URL path will change depending on your API request.

For example, if we want to get information about your Space, we can use the Get Space API path: /api/v2/space

So, the resulting URL is space domain + URL path, for example:
https://SPACEID.backlog.com/api/v2/space

3. Use CURL with your API key to send to the API endpoint

When we send the CURL request, we need to append our API key to the URL with ?apiKey= so that the system can authorize us successfully.

The resulting code for the Get Space curl command is:

curl https://spacedomain/api/v2/space?apiKey=YourAPIKey

:point_right: Substitute the space domain and YourAPIKey with your own details and give it a try. You should get a response with your space information.

How to send a CURL request?

We can send CURL requests using the terminal/command line (learn about CURL here), or use an online REST API testing tool like Reqbin or its online CURL:

:smiley: Congratulations! You have successfully made a request to the Backlog API.


Conclusion

By default, our curl command is a GET request, which means it gets information from the system.

If we want to add information, for e.g. add a new issue, we will need to send a curl POST request (to post information).

Want to learn more about using the Backlog API? Check out How to add issues using Backlog API

A post was split to a new topic: Revoke an oauth2 access token via API?