Workspaces
List Workspaces
List all workspaces available in your account.
GET
/
v1
/
workspace
/
List Workspaces
curl -X GET "https://management-api.suprsend.com/v1/workspace" \
--header 'Authorization: ServiceToken <SERVICE_TOKEN>' \
--header 'Content-Type: application/json'
import requests
url = "https://management-api.suprsend.com/v1/workspace/"
headers = {"ServiceToken <token>": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'ServiceToken <token>': '<api-key>'}};
fetch('https://management-api.suprsend.com/v1/workspace/', 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://management-api.suprsend.com/v1/workspace/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"ServiceToken <token>: <api-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://management-api.suprsend.com/v1/workspace/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("ServiceToken <token>", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://management-api.suprsend.com/v1/workspace/")
.header("ServiceToken <token>", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://management-api.suprsend.com/v1/workspace/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["ServiceToken <token>"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"meta": {
"count": 2,
"limit": 10,
"offset": 0
},
"results": [
{
"uid": "wksp_exampleUid01",
"slug": "staging",
"data_center": {},
"is_expired": false,
"has_limit_reached": false,
"name": "Staging",
"description": "Development environment to test iterations internally",
"mode": "sandbox"
},
{
"uid": "wksp_exampleUid02",
"slug": "production",
"data_center": {},
"is_expired": false,
"has_limit_reached": false,
"name": "Production",
"description": "Final environment to send notifications to live users",
"mode": "production"
}
]
}{
"code": 401,
"error_code": "authentication_failed",
"type": "AuthenticationFailed",
"message": "Invalid service token.",
"detail": "Invalid service token."
}Authorizations
You can get Service Token from SuprSend dashboard -> Account Settings -> Service Tokens section.
Was this page helpful?
⌘I
List Workspaces
curl -X GET "https://management-api.suprsend.com/v1/workspace" \
--header 'Authorization: ServiceToken <SERVICE_TOKEN>' \
--header 'Content-Type: application/json'
import requests
url = "https://management-api.suprsend.com/v1/workspace/"
headers = {"ServiceToken <token>": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'ServiceToken <token>': '<api-key>'}};
fetch('https://management-api.suprsend.com/v1/workspace/', 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://management-api.suprsend.com/v1/workspace/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"ServiceToken <token>: <api-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://management-api.suprsend.com/v1/workspace/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("ServiceToken <token>", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://management-api.suprsend.com/v1/workspace/")
.header("ServiceToken <token>", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://management-api.suprsend.com/v1/workspace/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["ServiceToken <token>"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"meta": {
"count": 2,
"limit": 10,
"offset": 0
},
"results": [
{
"uid": "wksp_exampleUid01",
"slug": "staging",
"data_center": {},
"is_expired": false,
"has_limit_reached": false,
"name": "Staging",
"description": "Development environment to test iterations internally",
"mode": "sandbox"
},
{
"uid": "wksp_exampleUid02",
"slug": "production",
"data_center": {},
"is_expired": false,
"has_limit_reached": false,
"name": "Production",
"description": "Final environment to send notifications to live users",
"mode": "production"
}
]
}{
"code": 401,
"error_code": "authentication_failed",
"type": "AuthenticationFailed",
"message": "Invalid service token.",
"detail": "Invalid service token."
}