curl --request POST \
--url https://eu.phrase.com/connectors/github2/v1/sync/upload-batch-raw-files \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"configuration": {
"useTree": true,
"createPr": true,
"prBaseBranch": "<string>",
"prTitle": "<string>",
"newBranchOrigin": "<string>",
"useCustomBranchName": true,
"customBranchName": "<string>"
},
"path": {
"owner": "<string>",
"repo": "<string>",
"branch": "<string>"
},
"files": [
{
"location": "<string>",
"storageId": "<string>"
}
],
"credentials": {},
"connectorUuid": "<string>"
}
'import requests
url = "https://eu.phrase.com/connectors/github2/v1/sync/upload-batch-raw-files"
payload = {
"configuration": {
"useTree": True,
"createPr": True,
"prBaseBranch": "<string>",
"prTitle": "<string>",
"newBranchOrigin": "<string>",
"useCustomBranchName": True,
"customBranchName": "<string>"
},
"path": {
"owner": "<string>",
"repo": "<string>",
"branch": "<string>"
},
"files": [
{
"location": "<string>",
"storageId": "<string>"
}
],
"credentials": {},
"connectorUuid": "<string>"
}
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({
configuration: {
useTree: true,
createPr: true,
prBaseBranch: '<string>',
prTitle: '<string>',
newBranchOrigin: '<string>',
useCustomBranchName: true,
customBranchName: '<string>'
},
path: {owner: '<string>', repo: '<string>', branch: '<string>'},
files: [{location: '<string>', storageId: '<string>'}],
credentials: {},
connectorUuid: '<string>'
})
};
fetch('https://eu.phrase.com/connectors/github2/v1/sync/upload-batch-raw-files', 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://eu.phrase.com/connectors/github2/v1/sync/upload-batch-raw-files",
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([
'configuration' => [
'useTree' => true,
'createPr' => true,
'prBaseBranch' => '<string>',
'prTitle' => '<string>',
'newBranchOrigin' => '<string>',
'useCustomBranchName' => true,
'customBranchName' => '<string>'
],
'path' => [
'owner' => '<string>',
'repo' => '<string>',
'branch' => '<string>'
],
'files' => [
[
'location' => '<string>',
'storageId' => '<string>'
]
],
'credentials' => [
],
'connectorUuid' => '<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 := "https://eu.phrase.com/connectors/github2/v1/sync/upload-batch-raw-files"
payload := strings.NewReader("{\n \"configuration\": {\n \"useTree\": true,\n \"createPr\": true,\n \"prBaseBranch\": \"<string>\",\n \"prTitle\": \"<string>\",\n \"newBranchOrigin\": \"<string>\",\n \"useCustomBranchName\": true,\n \"customBranchName\": \"<string>\"\n },\n \"path\": {\n \"owner\": \"<string>\",\n \"repo\": \"<string>\",\n \"branch\": \"<string>\"\n },\n \"files\": [\n {\n \"location\": \"<string>\",\n \"storageId\": \"<string>\"\n }\n ],\n \"credentials\": {},\n \"connectorUuid\": \"<string>\"\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://eu.phrase.com/connectors/github2/v1/sync/upload-batch-raw-files")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"configuration\": {\n \"useTree\": true,\n \"createPr\": true,\n \"prBaseBranch\": \"<string>\",\n \"prTitle\": \"<string>\",\n \"newBranchOrigin\": \"<string>\",\n \"useCustomBranchName\": true,\n \"customBranchName\": \"<string>\"\n },\n \"path\": {\n \"owner\": \"<string>\",\n \"repo\": \"<string>\",\n \"branch\": \"<string>\"\n },\n \"files\": [\n {\n \"location\": \"<string>\",\n \"storageId\": \"<string>\"\n }\n ],\n \"credentials\": {},\n \"connectorUuid\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu.phrase.com/connectors/github2/v1/sync/upload-batch-raw-files")
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 \"configuration\": {\n \"useTree\": true,\n \"createPr\": true,\n \"prBaseBranch\": \"<string>\",\n \"prTitle\": \"<string>\",\n \"newBranchOrigin\": \"<string>\",\n \"useCustomBranchName\": true,\n \"customBranchName\": \"<string>\"\n },\n \"path\": {\n \"owner\": \"<string>\",\n \"repo\": \"<string>\",\n \"branch\": \"<string>\"\n },\n \"files\": [\n {\n \"location\": \"<string>\",\n \"storageId\": \"<string>\"\n }\n ],\n \"credentials\": {},\n \"connectorUuid\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"errors": []
}Batch upload raw files synchronously — single commit via Git Blob/Tree API
curl --request POST \
--url https://eu.phrase.com/connectors/github2/v1/sync/upload-batch-raw-files \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"configuration": {
"useTree": true,
"createPr": true,
"prBaseBranch": "<string>",
"prTitle": "<string>",
"newBranchOrigin": "<string>",
"useCustomBranchName": true,
"customBranchName": "<string>"
},
"path": {
"owner": "<string>",
"repo": "<string>",
"branch": "<string>"
},
"files": [
{
"location": "<string>",
"storageId": "<string>"
}
],
"credentials": {},
"connectorUuid": "<string>"
}
'import requests
url = "https://eu.phrase.com/connectors/github2/v1/sync/upload-batch-raw-files"
payload = {
"configuration": {
"useTree": True,
"createPr": True,
"prBaseBranch": "<string>",
"prTitle": "<string>",
"newBranchOrigin": "<string>",
"useCustomBranchName": True,
"customBranchName": "<string>"
},
"path": {
"owner": "<string>",
"repo": "<string>",
"branch": "<string>"
},
"files": [
{
"location": "<string>",
"storageId": "<string>"
}
],
"credentials": {},
"connectorUuid": "<string>"
}
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({
configuration: {
useTree: true,
createPr: true,
prBaseBranch: '<string>',
prTitle: '<string>',
newBranchOrigin: '<string>',
useCustomBranchName: true,
customBranchName: '<string>'
},
path: {owner: '<string>', repo: '<string>', branch: '<string>'},
files: [{location: '<string>', storageId: '<string>'}],
credentials: {},
connectorUuid: '<string>'
})
};
fetch('https://eu.phrase.com/connectors/github2/v1/sync/upload-batch-raw-files', 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://eu.phrase.com/connectors/github2/v1/sync/upload-batch-raw-files",
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([
'configuration' => [
'useTree' => true,
'createPr' => true,
'prBaseBranch' => '<string>',
'prTitle' => '<string>',
'newBranchOrigin' => '<string>',
'useCustomBranchName' => true,
'customBranchName' => '<string>'
],
'path' => [
'owner' => '<string>',
'repo' => '<string>',
'branch' => '<string>'
],
'files' => [
[
'location' => '<string>',
'storageId' => '<string>'
]
],
'credentials' => [
],
'connectorUuid' => '<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 := "https://eu.phrase.com/connectors/github2/v1/sync/upload-batch-raw-files"
payload := strings.NewReader("{\n \"configuration\": {\n \"useTree\": true,\n \"createPr\": true,\n \"prBaseBranch\": \"<string>\",\n \"prTitle\": \"<string>\",\n \"newBranchOrigin\": \"<string>\",\n \"useCustomBranchName\": true,\n \"customBranchName\": \"<string>\"\n },\n \"path\": {\n \"owner\": \"<string>\",\n \"repo\": \"<string>\",\n \"branch\": \"<string>\"\n },\n \"files\": [\n {\n \"location\": \"<string>\",\n \"storageId\": \"<string>\"\n }\n ],\n \"credentials\": {},\n \"connectorUuid\": \"<string>\"\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://eu.phrase.com/connectors/github2/v1/sync/upload-batch-raw-files")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"configuration\": {\n \"useTree\": true,\n \"createPr\": true,\n \"prBaseBranch\": \"<string>\",\n \"prTitle\": \"<string>\",\n \"newBranchOrigin\": \"<string>\",\n \"useCustomBranchName\": true,\n \"customBranchName\": \"<string>\"\n },\n \"path\": {\n \"owner\": \"<string>\",\n \"repo\": \"<string>\",\n \"branch\": \"<string>\"\n },\n \"files\": [\n {\n \"location\": \"<string>\",\n \"storageId\": \"<string>\"\n }\n ],\n \"credentials\": {},\n \"connectorUuid\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu.phrase.com/connectors/github2/v1/sync/upload-batch-raw-files")
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 \"configuration\": {\n \"useTree\": true,\n \"createPr\": true,\n \"prBaseBranch\": \"<string>\",\n \"prTitle\": \"<string>\",\n \"newBranchOrigin\": \"<string>\",\n \"useCustomBranchName\": true,\n \"customBranchName\": \"<string>\"\n },\n \"path\": {\n \"owner\": \"<string>\",\n \"repo\": \"<string>\",\n \"branch\": \"<string>\"\n },\n \"files\": [\n {\n \"location\": \"<string>\",\n \"storageId\": \"<string>\"\n }\n ],\n \"credentials\": {},\n \"connectorUuid\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"errors": []
}Authorizations
IDM-issued JWT. Obtain via the IDM authentication flow and pass as: Bearer
Headers
A logging ID of the request. It is propagated through Phrase systems, making it easier to connect logs from various services. If no ActionId is sent with a request, one will be generated by Bifrost and returned with the response.
Body
Github2 configuration
Show child attributes
Show child attributes
Path within Github2 repository
Show child attributes
Show child attributes
List of files to upload
Show child attributes
Show child attributes
Credentials for Github2 connector
Connector UUID if using stored credentials
Response
Successful operation. If X-ResponseType is set to 'ID' or no value is sent in the header, the file is saved and can be retrieved by sending a GET request to this endpoint. If X-ResponseType is set to 'OBJECT', the file is returned as a stream.
Was this page helpful?