storage-connections
Connect a bucket with your own key: test it, then seal it and create a read-only connection
POST
/
api
/
v1
/
storage-credentials
Connect a bucket with your own key: test it, then seal it and create a read-only connection
curl --request POST \
--url https://api.nitsor.com/api/v1/storage-credentials \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"bucket": "<string>",
"credentials": {
"accessKeyId": "<string>",
"secretAccessKey": "<string>"
},
"idempotencyKey": "<string>",
"name": "<string>",
"pathStyle": true,
"prefix": "<string>",
"region": "<string>",
"endpoint": "<string>",
"provider": {
"kind": "amazon-s3"
}
}
'import requests
url = "https://api.nitsor.com/api/v1/storage-credentials"
payload = {
"bucket": "<string>",
"credentials": {
"accessKeyId": "<string>",
"secretAccessKey": "<string>"
},
"idempotencyKey": "<string>",
"name": "<string>",
"pathStyle": True,
"prefix": "<string>",
"region": "<string>",
"endpoint": "<string>",
"provider": { "kind": "amazon-s3" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
bucket: '<string>',
credentials: {accessKeyId: '<string>', secretAccessKey: '<string>'},
idempotencyKey: '<string>',
name: '<string>',
pathStyle: true,
prefix: '<string>',
region: '<string>',
endpoint: '<string>',
provider: {kind: 'amazon-s3'}
})
};
fetch('https://api.nitsor.com/api/v1/storage-credentials', 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.nitsor.com/api/v1/storage-credentials",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'bucket' => '<string>',
'credentials' => [
'accessKeyId' => '<string>',
'secretAccessKey' => '<string>'
],
'idempotencyKey' => '<string>',
'name' => '<string>',
'pathStyle' => true,
'prefix' => '<string>',
'region' => '<string>',
'endpoint' => '<string>',
'provider' => [
'kind' => 'amazon-s3'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.nitsor.com/api/v1/storage-credentials"
payload := strings.NewReader("{\n \"bucket\": \"<string>\",\n \"credentials\": {\n \"accessKeyId\": \"<string>\",\n \"secretAccessKey\": \"<string>\"\n },\n \"idempotencyKey\": \"<string>\",\n \"name\": \"<string>\",\n \"pathStyle\": true,\n \"prefix\": \"<string>\",\n \"region\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"provider\": {\n \"kind\": \"amazon-s3\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.nitsor.com/api/v1/storage-credentials")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"bucket\": \"<string>\",\n \"credentials\": {\n \"accessKeyId\": \"<string>\",\n \"secretAccessKey\": \"<string>\"\n },\n \"idempotencyKey\": \"<string>\",\n \"name\": \"<string>\",\n \"pathStyle\": true,\n \"prefix\": \"<string>\",\n \"region\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"provider\": {\n \"kind\": \"amazon-s3\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nitsor.com/api/v1/storage-credentials")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"bucket\": \"<string>\",\n \"credentials\": {\n \"accessKeyId\": \"<string>\",\n \"secretAccessKey\": \"<string>\"\n },\n \"idempotencyKey\": \"<string>\",\n \"name\": \"<string>\",\n \"pathStyle\": true,\n \"prefix\": \"<string>\",\n \"region\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"provider\": {\n \"kind\": \"amazon-s3\"\n }\n}"
response = http.request(request)
puts response.read_body{
"capabilities": {
"browserGet": {
"status": "passed"
},
"list": {
"status": "passed"
},
"read": {
"status": "passed"
}
},
"connection": {
"accountId": "<string>",
"bucket": "<string>",
"connectionId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"credential": {
"handleId": "<string>",
"kind": "handle",
"label": "<string>"
},
"endpoint": "<string>",
"name": "<string>",
"pathStyle": true,
"prefix": "<string>",
"region": "<string>",
"provider": {
"kind": "amazon-s3"
}
},
"status": "connected"
}{
"requestId": "<string>",
"retryable": true,
"code": "AUTHORIZATION_DENIED",
"message": "<string>",
"missingScope": "<string>",
"reason": "<string>",
"decisionId": "<string>"
}{
"requestId": "<string>",
"retryable": true,
"code": "AUTHORIZATION_DENIED",
"message": "<string>",
"missingScope": "<string>",
"reason": "<string>",
"decisionId": "<string>"
}{
"requestId": "<string>",
"retryable": true,
"code": "AUTHORIZATION_DENIED",
"message": "<string>",
"missingScope": "<string>",
"reason": "<string>",
"decisionId": "<string>"
}{
"requestId": "<string>",
"retryable": true,
"code": "AUTHORIZATION_DENIED",
"message": "<string>",
"missingScope": "<string>",
"reason": "<string>",
"decisionId": "<string>"
}{
"requestId": "<string>",
"retryable": true,
"code": "AUTHORIZATION_DENIED",
"message": "<string>",
"missingScope": "<string>",
"reason": "<string>",
"decisionId": "<string>"
}{
"requestId": "<string>",
"retryable": true,
"code": "AUTHORIZATION_DENIED",
"message": "<string>",
"missingScope": "<string>",
"reason": "<string>",
"decisionId": "<string>"
}{
"requestId": "<string>",
"retryable": true,
"code": "AUTHORIZATION_DENIED",
"message": "<string>",
"missingScope": "<string>",
"reason": "<string>",
"decisionId": "<string>"
}{
"requestId": "<string>",
"retryable": true,
"code": "AUTHORIZATION_DENIED",
"message": "<string>",
"missingScope": "<string>",
"reason": "<string>",
"decisionId": "<string>"
}{
"requestId": "<string>",
"retryable": true,
"code": "AUTHORIZATION_DENIED",
"message": "<string>",
"missingScope": "<string>",
"reason": "<string>",
"decisionId": "<string>"
}No plan can call this operation today. It needs a personal access token, and Nitsor does not issue personal access tokens.
Authorizations
Body
application/json
⌘I
Connect a bucket with your own key: test it, then seal it and create a read-only connection
curl --request POST \
--url https://api.nitsor.com/api/v1/storage-credentials \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"bucket": "<string>",
"credentials": {
"accessKeyId": "<string>",
"secretAccessKey": "<string>"
},
"idempotencyKey": "<string>",
"name": "<string>",
"pathStyle": true,
"prefix": "<string>",
"region": "<string>",
"endpoint": "<string>",
"provider": {
"kind": "amazon-s3"
}
}
'import requests
url = "https://api.nitsor.com/api/v1/storage-credentials"
payload = {
"bucket": "<string>",
"credentials": {
"accessKeyId": "<string>",
"secretAccessKey": "<string>"
},
"idempotencyKey": "<string>",
"name": "<string>",
"pathStyle": True,
"prefix": "<string>",
"region": "<string>",
"endpoint": "<string>",
"provider": { "kind": "amazon-s3" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
bucket: '<string>',
credentials: {accessKeyId: '<string>', secretAccessKey: '<string>'},
idempotencyKey: '<string>',
name: '<string>',
pathStyle: true,
prefix: '<string>',
region: '<string>',
endpoint: '<string>',
provider: {kind: 'amazon-s3'}
})
};
fetch('https://api.nitsor.com/api/v1/storage-credentials', 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.nitsor.com/api/v1/storage-credentials",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'bucket' => '<string>',
'credentials' => [
'accessKeyId' => '<string>',
'secretAccessKey' => '<string>'
],
'idempotencyKey' => '<string>',
'name' => '<string>',
'pathStyle' => true,
'prefix' => '<string>',
'region' => '<string>',
'endpoint' => '<string>',
'provider' => [
'kind' => 'amazon-s3'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.nitsor.com/api/v1/storage-credentials"
payload := strings.NewReader("{\n \"bucket\": \"<string>\",\n \"credentials\": {\n \"accessKeyId\": \"<string>\",\n \"secretAccessKey\": \"<string>\"\n },\n \"idempotencyKey\": \"<string>\",\n \"name\": \"<string>\",\n \"pathStyle\": true,\n \"prefix\": \"<string>\",\n \"region\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"provider\": {\n \"kind\": \"amazon-s3\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.nitsor.com/api/v1/storage-credentials")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"bucket\": \"<string>\",\n \"credentials\": {\n \"accessKeyId\": \"<string>\",\n \"secretAccessKey\": \"<string>\"\n },\n \"idempotencyKey\": \"<string>\",\n \"name\": \"<string>\",\n \"pathStyle\": true,\n \"prefix\": \"<string>\",\n \"region\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"provider\": {\n \"kind\": \"amazon-s3\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nitsor.com/api/v1/storage-credentials")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"bucket\": \"<string>\",\n \"credentials\": {\n \"accessKeyId\": \"<string>\",\n \"secretAccessKey\": \"<string>\"\n },\n \"idempotencyKey\": \"<string>\",\n \"name\": \"<string>\",\n \"pathStyle\": true,\n \"prefix\": \"<string>\",\n \"region\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"provider\": {\n \"kind\": \"amazon-s3\"\n }\n}"
response = http.request(request)
puts response.read_body{
"capabilities": {
"browserGet": {
"status": "passed"
},
"list": {
"status": "passed"
},
"read": {
"status": "passed"
}
},
"connection": {
"accountId": "<string>",
"bucket": "<string>",
"connectionId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"credential": {
"handleId": "<string>",
"kind": "handle",
"label": "<string>"
},
"endpoint": "<string>",
"name": "<string>",
"pathStyle": true,
"prefix": "<string>",
"region": "<string>",
"provider": {
"kind": "amazon-s3"
}
},
"status": "connected"
}{
"requestId": "<string>",
"retryable": true,
"code": "AUTHORIZATION_DENIED",
"message": "<string>",
"missingScope": "<string>",
"reason": "<string>",
"decisionId": "<string>"
}{
"requestId": "<string>",
"retryable": true,
"code": "AUTHORIZATION_DENIED",
"message": "<string>",
"missingScope": "<string>",
"reason": "<string>",
"decisionId": "<string>"
}{
"requestId": "<string>",
"retryable": true,
"code": "AUTHORIZATION_DENIED",
"message": "<string>",
"missingScope": "<string>",
"reason": "<string>",
"decisionId": "<string>"
}{
"requestId": "<string>",
"retryable": true,
"code": "AUTHORIZATION_DENIED",
"message": "<string>",
"missingScope": "<string>",
"reason": "<string>",
"decisionId": "<string>"
}{
"requestId": "<string>",
"retryable": true,
"code": "AUTHORIZATION_DENIED",
"message": "<string>",
"missingScope": "<string>",
"reason": "<string>",
"decisionId": "<string>"
}{
"requestId": "<string>",
"retryable": true,
"code": "AUTHORIZATION_DENIED",
"message": "<string>",
"missingScope": "<string>",
"reason": "<string>",
"decisionId": "<string>"
}{
"requestId": "<string>",
"retryable": true,
"code": "AUTHORIZATION_DENIED",
"message": "<string>",
"missingScope": "<string>",
"reason": "<string>",
"decisionId": "<string>"
}{
"requestId": "<string>",
"retryable": true,
"code": "AUTHORIZATION_DENIED",
"message": "<string>",
"missingScope": "<string>",
"reason": "<string>",
"decisionId": "<string>"
}{
"requestId": "<string>",
"retryable": true,
"code": "AUTHORIZATION_DENIED",
"message": "<string>",
"missingScope": "<string>",
"reason": "<string>",
"decisionId": "<string>"
}