프로젝트 복제 (동기)
curl --request POST \
--url https://api.edicus.io/v2/projects/{project_id}/clone \
--header 'edicus-api-key: <api-key>' \
--header 'edicus-uid: <edicus-uid>'import requests
url = "https://api.edicus.io/v2/projects/{project_id}/clone"
headers = {
"edicus-uid": "<edicus-uid>",
"edicus-api-key": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'edicus-uid': '<edicus-uid>', 'edicus-api-key': '<api-key>'}
};
fetch('https://api.edicus.io/v2/projects/{project_id}/clone', 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.edicus.io/v2/projects/{project_id}/clone",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"edicus-api-key: <api-key>",
"edicus-uid: <edicus-uid>"
],
]);
$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.edicus.io/v2/projects/{project_id}/clone"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("edicus-uid", "<edicus-uid>")
req.Header.Add("edicus-api-key", "<api-key>")
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.edicus.io/v2/projects/{project_id}/clone")
.header("edicus-uid", "<edicus-uid>")
.header("edicus-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.edicus.io/v2/projects/{project_id}/clone")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["edicus-uid"] = '<edicus-uid>'
request["edicus-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"project_id": "-LEnOT7xY0ZJgXAVfc0p",
"preview_tns": [
{
"url": "https://.../1.jpg"
}
]
}프로젝트
프로젝트 복제 (동기)
프로젝트를 복제하고 새 프로젝트 id와 프리뷰 썸네일 목록을 반환합니다. 복제된 프로젝트의 제목에는 (복제됨)이 붙습니다.
edicus-target-uid를 주면 그 사용자에게 복제되고, 없으면 edicus-uid와 같은 사용자에게 복제됩니다.
같은 원본을 복제하는 요청이 진행 중이면 새 요청은 409 clone_in_progress로 거절됩니다. 복제가 끝나면 다시 요청할 수 있고, 끝나지 못한 복제는 10분 뒤 자동으로 풀립니다. 복제 가능 여부를 미리 보려면 복제 가능 여부 확인을 씁니다.
포토북처럼 이미지가 많은 프로젝트는 복제에 수십 초 이상 걸려 타임아웃이 날 수 있습니다. 그런 경우 비동기 복제를 씁니다.
POST
/
v2
/
projects
/
{project_id}
/
clone
프로젝트 복제 (동기)
curl --request POST \
--url https://api.edicus.io/v2/projects/{project_id}/clone \
--header 'edicus-api-key: <api-key>' \
--header 'edicus-uid: <edicus-uid>'import requests
url = "https://api.edicus.io/v2/projects/{project_id}/clone"
headers = {
"edicus-uid": "<edicus-uid>",
"edicus-api-key": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'edicus-uid': '<edicus-uid>', 'edicus-api-key': '<api-key>'}
};
fetch('https://api.edicus.io/v2/projects/{project_id}/clone', 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.edicus.io/v2/projects/{project_id}/clone",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"edicus-api-key: <api-key>",
"edicus-uid: <edicus-uid>"
],
]);
$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.edicus.io/v2/projects/{project_id}/clone"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("edicus-uid", "<edicus-uid>")
req.Header.Add("edicus-api-key", "<api-key>")
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.edicus.io/v2/projects/{project_id}/clone")
.header("edicus-uid", "<edicus-uid>")
.header("edicus-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.edicus.io/v2/projects/{project_id}/clone")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["edicus-uid"] = '<edicus-uid>'
request["edicus-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"project_id": "-LEnOT7xY0ZJgXAVfc0p",
"preview_tns": [
{
"url": "https://.../1.jpg"
}
]
}