Say where a brand's files live
curl --request PUT \
--url http://localhost:3000/api/v1/brands/{slug}/source \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"remote": "<string>",
"branch": "<string>",
"path": "<string>"
}
'import requests
url = "http://localhost:3000/api/v1/brands/{slug}/source"
payload = {
"remote": "<string>",
"branch": "<string>",
"path": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({remote: '<string>', branch: '<string>', path: '<string>'})
};
fetch('http://localhost:3000/api/v1/brands/{slug}/source', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/v1/brands/{slug}/source",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'remote' => '<string>',
'branch' => '<string>',
'path' => '<string>'
]),
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 := "http://localhost:3000/api/v1/brands/{slug}/source"
payload := strings.NewReader("{\n \"remote\": \"<string>\",\n \"branch\": \"<string>\",\n \"path\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("http://localhost:3000/api/v1/brands/{slug}/source")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"remote\": \"<string>\",\n \"branch\": \"<string>\",\n \"path\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/v1/brands/{slug}/source")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"remote\": \"<string>\",\n \"branch\": \"<string>\",\n \"path\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"remote": "<string>",
"branch": "<string>",
"path": "<string>",
"commit": "<string>",
"syncedAt": "2023-11-07T05:31:56Z",
"pending": true,
"files": 0
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"detail": "<unknown>"
}
}API Reference
Say where a brand's files live
Moving it to another repository, branch or folder forgets what was agreed: the next import takes the files whole. After pushing an export, send the files pushed as synced with their commit: they become what both sides agree on. Takes setup on the workspace.
Scope: write.
PUT
/
api
/
v1
/
brands
/
{slug}
/
source
Say where a brand's files live
curl --request PUT \
--url http://localhost:3000/api/v1/brands/{slug}/source \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"remote": "<string>",
"branch": "<string>",
"path": "<string>"
}
'import requests
url = "http://localhost:3000/api/v1/brands/{slug}/source"
payload = {
"remote": "<string>",
"branch": "<string>",
"path": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({remote: '<string>', branch: '<string>', path: '<string>'})
};
fetch('http://localhost:3000/api/v1/brands/{slug}/source', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/v1/brands/{slug}/source",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'remote' => '<string>',
'branch' => '<string>',
'path' => '<string>'
]),
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 := "http://localhost:3000/api/v1/brands/{slug}/source"
payload := strings.NewReader("{\n \"remote\": \"<string>\",\n \"branch\": \"<string>\",\n \"path\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("http://localhost:3000/api/v1/brands/{slug}/source")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"remote\": \"<string>\",\n \"branch\": \"<string>\",\n \"path\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/v1/brands/{slug}/source")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"remote\": \"<string>\",\n \"branch\": \"<string>\",\n \"path\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"remote": "<string>",
"branch": "<string>",
"path": "<string>",
"commit": "<string>",
"syncedAt": "2023-11-07T05:31:56Z",
"pending": true,
"files": 0
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"detail": "<unknown>"
}
}Authorizations
bearersession
An API key: ab_...
Path Parameters
Brand slug
Body
application/json
The repository, as its host shows it: https://github.com/acme/brand
Maximum string length:
500main when left out
Required string length:
1 - 255The brand's folder in the repository; its root when left out
Maximum string length:
500The files just pushed, at commit: recorded as what both sides agree on
Show child attributes
Show child attributes
Response
The source
Show child attributes
Show child attributes