REST reference
Get the current user
Get the Boxpressd user connected through OAuth.
GET
/
v1
/
me
Get the current user
curl --request GET \
--url https://api.example.com/v1/me \
--header 'Authorization: <authorization>' \
--header 'x-boxpressd-key: <x-boxpressd-key>'import requests
url = "https://api.example.com/v1/me"
headers = {
"x-boxpressd-key": "<x-boxpressd-key>",
"Authorization": "<authorization>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-boxpressd-key': '<x-boxpressd-key>', Authorization: '<authorization>'}
};
fetch('https://api.example.com/v1/me', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/me",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"x-boxpressd-key: <x-boxpressd-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/me"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-boxpressd-key", "<x-boxpressd-key>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/me")
.header("x-boxpressd-key", "<x-boxpressd-key>")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/me")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-boxpressd-key"] = '<x-boxpressd-key>'
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_bodyThis route requires both application and user authentication.
The response can include
string
required
Your developer application key.
string
required
Bearer <access-token> with profile:read. The email field also requires email:read.curl "https://api.boxpressd.com/v1/me" \
--header "x-boxpressd-key: $BOXPRESSD_DEVELOPER_API_KEY" \
--header "Authorization: Bearer $BOXPRESSD_ACCESS_TOKEN"
id, displayName, firstName, lastName, email, imageUrl, coverUrl, website, and bio, subject to granted scopes.⌘I
Get the current user
curl --request GET \
--url https://api.example.com/v1/me \
--header 'Authorization: <authorization>' \
--header 'x-boxpressd-key: <x-boxpressd-key>'import requests
url = "https://api.example.com/v1/me"
headers = {
"x-boxpressd-key": "<x-boxpressd-key>",
"Authorization": "<authorization>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-boxpressd-key': '<x-boxpressd-key>', Authorization: '<authorization>'}
};
fetch('https://api.example.com/v1/me', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/me",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"x-boxpressd-key: <x-boxpressd-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/me"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-boxpressd-key", "<x-boxpressd-key>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/me")
.header("x-boxpressd-key", "<x-boxpressd-key>")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/me")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-boxpressd-key"] = '<x-boxpressd-key>'
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body