Prismy Hosted
Merge branch
Merges a Prismy branch into the main branch for a specific repository
POST
/
api
/
public
/
prismy-hosted
/
merge-branch
Merge branch into main
curl --request POST \
--url https://app.prismy.io/api/public/prismy-hosted/merge-branch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"repositoryName": "my-repo",
"branch": "feature/new-translations"
}
'import requests
url = "https://app.prismy.io/api/public/prismy-hosted/merge-branch"
payload = {
"repositoryName": "my-repo",
"branch": "feature/new-translations"
}
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({repositoryName: 'my-repo', branch: 'feature/new-translations'})
};
fetch('https://app.prismy.io/api/public/prismy-hosted/merge-branch', 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://app.prismy.io/api/public/prismy-hosted/merge-branch",
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([
'repositoryName' => 'my-repo',
'branch' => 'feature/new-translations'
]),
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://app.prismy.io/api/public/prismy-hosted/merge-branch"
payload := strings.NewReader("{\n \"repositoryName\": \"my-repo\",\n \"branch\": \"feature/new-translations\"\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://app.prismy.io/api/public/prismy-hosted/merge-branch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"repositoryName\": \"my-repo\",\n \"branch\": \"feature/new-translations\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.prismy.io/api/public/prismy-hosted/merge-branch")
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 \"repositoryName\": \"my-repo\",\n \"branch\": \"feature/new-translations\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Successfully merged branch 'feature/new-translations' into 'main'",
"branch": "feature/new-translations",
"mainBranch": "main",
"filesProcessed": 5,
"successfulMerges": 5,
"failedMerges": 0,
"totalKeysAdded": 12,
"totalKeysUpdated": 3,
"totalKeysKeptFromMain": 45,
"versionsUpdated": 15,
"results": [
{
"success": true,
"filePath": "<string>",
"language": "<string>",
"keysAdded": 123,
"keysUpdated": 123,
"keysKeptFromMain": 123
}
]
}Authorizations
API token from your organization settings
Body
application/json
Response
Branch merged successfully
Example:
true
Example:
"Successfully merged branch 'feature/new-translations' into 'main'"
Example:
"feature/new-translations"
Example:
"main"
Number of files processed during merge
Example:
5
Number of files successfully merged
Example:
5
Number of files that failed to merge
Example:
0
Total number of new keys added from branch
Example:
12
Total number of keys updated during merge
Example:
3
Total number of keys kept from main branch
Example:
45
Number of key versions updated
Example:
15
Detailed results for each file processed
Show child attributes
Show child attributes
⌘I
Merge branch into main
curl --request POST \
--url https://app.prismy.io/api/public/prismy-hosted/merge-branch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"repositoryName": "my-repo",
"branch": "feature/new-translations"
}
'import requests
url = "https://app.prismy.io/api/public/prismy-hosted/merge-branch"
payload = {
"repositoryName": "my-repo",
"branch": "feature/new-translations"
}
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({repositoryName: 'my-repo', branch: 'feature/new-translations'})
};
fetch('https://app.prismy.io/api/public/prismy-hosted/merge-branch', 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://app.prismy.io/api/public/prismy-hosted/merge-branch",
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([
'repositoryName' => 'my-repo',
'branch' => 'feature/new-translations'
]),
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://app.prismy.io/api/public/prismy-hosted/merge-branch"
payload := strings.NewReader("{\n \"repositoryName\": \"my-repo\",\n \"branch\": \"feature/new-translations\"\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://app.prismy.io/api/public/prismy-hosted/merge-branch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"repositoryName\": \"my-repo\",\n \"branch\": \"feature/new-translations\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.prismy.io/api/public/prismy-hosted/merge-branch")
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 \"repositoryName\": \"my-repo\",\n \"branch\": \"feature/new-translations\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Successfully merged branch 'feature/new-translations' into 'main'",
"branch": "feature/new-translations",
"mainBranch": "main",
"filesProcessed": 5,
"successfulMerges": 5,
"failedMerges": 0,
"totalKeysAdded": 12,
"totalKeysUpdated": 3,
"totalKeysKeptFromMain": 45,
"versionsUpdated": 15,
"results": [
{
"success": true,
"filePath": "<string>",
"language": "<string>",
"keysAdded": 123,
"keysUpdated": 123,
"keysKeptFromMain": 123
}
]
}