Basic 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. Send requests to Backlog API with CURL
  3. Try CURL with your API key

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. Send requests to Backlog API with CURL

We can make requests using the CURL command (via terminal/command line), or use an online REST API testing tool like Reqbin or its online CURL.

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. Try CURL with your API key to get Space information

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.

: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