Hello World

This article will show you how to start the work with Buddy’s API: get the authentication token and execute API methods.

Authentication

Before you can use API, you need to authenticate. Authentication is based on oAuth mechanisms. In order to invoke an API method, you need an access token. Buddy allows you to generate a “Personal access token” which makes getting started easier. You can get it in your profile ID. When generating the token, you need to choose the list of scopes for data access.

Other ways to obtain the token are described in oAuth.

Retrieving API data for the first time

The easiest way to invoke an API method is cURL. Open the terminal and invoke it with the previously generated token:

$curl https://api.buddy.works/user?access_token=732e9e20-50ba-4047-8a7b-c9b17259a2a2

or send token as header

$ curl --header "Authorization: Bearer 732e9e20-50ba-4047-8a7b-c9b17259a2a2" https://api.buddy.works/user

This will receive the data about your profile in the JSON format:

Sample Response

HTTP

Status: 200 OK X-Rate-Limit-Limit: 1 X-Rate-Limit-Remaining: 999

JSON

json
{ "url": "https://api.buddy.works/user", "html_url": "https://app.buddy.works/my-id", "id": 1, "name": "Mike Benson", "avatar_url": "https://app.buddy.works/image-server/user/0/0/0/0/0/0/1/d643744fbe5ebf2906a4d075a5b97110/w/32/32/AVATAR.png", "workspaces_url": "https://api.buddy.works/workspaces" }

First update of data from API

To update your profile, you just need to send a PATCH with the variable to edit:

$ curl -request PATCH --data "{\"title\": \"Buddy is awesome! He's my friend and shit\"}" https://api.buddy.works/user

The following documentation describes all API methods of Buddy. In case of questions or requests, visit our forum, or contact us directly support@buddy.works

Last modified on Oct 7, 2024