Copy file into workspace
curl --request POST \
--url https://api.diversion.dev/v0/repos/{repo_id}/workspaces/{workspace_id}/copy_from/{ref_id}/{path} \
--header 'Authorization: Bearer <token>' \
--header 'X-Dv-Client-Id: <x-dv-client-id>'import requests
url = "https://api.diversion.dev/v0/repos/{repo_id}/workspaces/{workspace_id}/copy_from/{ref_id}/{path}"
headers = {
"X-Dv-Client-Id": "<x-dv-client-id>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Dv-Client-Id': '<x-dv-client-id>', Authorization: 'Bearer <token>'}
};
fetch('https://api.diversion.dev/v0/repos/{repo_id}/workspaces/{workspace_id}/copy_from/{ref_id}/{path}', 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.diversion.dev/v0/repos/{repo_id}/workspaces/{workspace_id}/copy_from/{ref_id}/{path}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"X-Dv-Client-Id: <x-dv-client-id>"
],
]);
$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://api.diversion.dev/v0/repos/{repo_id}/workspaces/{workspace_id}/copy_from/{ref_id}/{path}"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Dv-Client-Id", "<x-dv-client-id>")
req.Header.Add("Authorization", "Bearer <token>")
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.diversion.dev/v0/repos/{repo_id}/workspaces/{workspace_id}/copy_from/{ref_id}/{path}")
.header("X-Dv-Client-Id", "<x-dv-client-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.diversion.dev/v0/repos/{repo_id}/workspaces/{workspace_id}/copy_from/{ref_id}/{path}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Dv-Client-Id"] = '<x-dv-client-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": 123,
"detail": "<string>",
"title": "<string>",
"type": "<string>"
}{
"status": 123,
"detail": "<string>",
"title": "<string>",
"type": "<string>"
}{
"status": 123,
"detail": "<string>",
"title": "<string>",
"type": "<string>"
}ワークスペース操作
Copy file into workspace
Copy a file from a ref to the workspace, overwriting any existing file.
POST
/
repos
/
{repo_id}
/
workspaces
/
{workspace_id}
/
copy_from
/
{ref_id}
/
{path}
Copy file into workspace
curl --request POST \
--url https://api.diversion.dev/v0/repos/{repo_id}/workspaces/{workspace_id}/copy_from/{ref_id}/{path} \
--header 'Authorization: Bearer <token>' \
--header 'X-Dv-Client-Id: <x-dv-client-id>'import requests
url = "https://api.diversion.dev/v0/repos/{repo_id}/workspaces/{workspace_id}/copy_from/{ref_id}/{path}"
headers = {
"X-Dv-Client-Id": "<x-dv-client-id>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Dv-Client-Id': '<x-dv-client-id>', Authorization: 'Bearer <token>'}
};
fetch('https://api.diversion.dev/v0/repos/{repo_id}/workspaces/{workspace_id}/copy_from/{ref_id}/{path}', 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.diversion.dev/v0/repos/{repo_id}/workspaces/{workspace_id}/copy_from/{ref_id}/{path}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"X-Dv-Client-Id: <x-dv-client-id>"
],
]);
$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://api.diversion.dev/v0/repos/{repo_id}/workspaces/{workspace_id}/copy_from/{ref_id}/{path}"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Dv-Client-Id", "<x-dv-client-id>")
req.Header.Add("Authorization", "Bearer <token>")
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.diversion.dev/v0/repos/{repo_id}/workspaces/{workspace_id}/copy_from/{ref_id}/{path}")
.header("X-Dv-Client-Id", "<x-dv-client-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.diversion.dev/v0/repos/{repo_id}/workspaces/{workspace_id}/copy_from/{ref_id}/{path}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Dv-Client-Id"] = '<x-dv-client-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": 123,
"detail": "<string>",
"title": "<string>",
"type": "<string>"
}{
"status": 123,
"detail": "<string>",
"title": "<string>",
"type": "<string>"
}{
"status": 123,
"detail": "<string>",
"title": "<string>",
"type": "<string>"
}Authorizations
This API uses OAuth 2 with the implicit grant flow
Headers
The unique id of the client making this request
Path Parameters
The repo ID of the repository. Repo name can be used instead of the ID, but usage of ID for permanent linking and API requests is preferred.
Required string length:
3 - 128Example:
"example_id"
The repo ID of the workspace.
Required string length:
3 - 128Example:
"example_id"
An ID of a workspace, branch or commit.
Required string length:
3 - 128Example:
"example_id"
A path to an item inside the repository.
Example:
"/path/to/file"
Response
Request completed successfully
⌘I

