프로젝트 복제 (비동기)
curl --request POST \
--url https://api.edicus.io/v2/projects/{project_id}/clone_async \
--header 'Content-Type: application/json' \
--header 'edicus-api-key: <api-key>' \
--header 'edicus-uid: <edicus-uid>' \
--data '
{
"callback_url": "https://partner.example.com/edicus/clone-done"
}
'import requests
url = "https://api.edicus.io/v2/projects/{project_id}/clone_async"
payload = { "callback_url": "https://partner.example.com/edicus/clone-done" }
headers = {
"edicus-uid": "<edicus-uid>",
"edicus-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'edicus-uid': '<edicus-uid>',
'edicus-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({callback_url: 'https://partner.example.com/edicus/clone-done'})
};
fetch('https://api.edicus.io/v2/projects/{project_id}/clone_async', 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_async",
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([
'callback_url' => 'https://partner.example.com/edicus/clone-done'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.edicus.io/v2/projects/{project_id}/clone_async"
payload := strings.NewReader("{\n \"callback_url\": \"https://partner.example.com/edicus/clone-done\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("edicus-uid", "<edicus-uid>")
req.Header.Add("edicus-api-key", "<api-key>")
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://api.edicus.io/v2/projects/{project_id}/clone_async")
.header("edicus-uid", "<edicus-uid>")
.header("edicus-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"callback_url\": \"https://partner.example.com/edicus/clone-done\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.edicus.io/v2/projects/{project_id}/clone_async")
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>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"callback_url\": \"https://partner.example.com/edicus/clone-done\"\n}"
response = http.request(request)
puts response.read_body{
"project_id": "-LEnOT7xY0ZJgXAVfc0p"
}프로젝트
프로젝트 복제 (비동기)
새 프로젝트 id를 202 Accepted로 즉시 반환하고 복제는 서버에서 계속 진행합니다. 복제 중인 프로젝트의 상태는 cloning이고, 끝나면 editing으로 바뀝니다. 상태는 프로젝트 조회로 확인합니다.
cloning 상태인 프로젝트를 편집기로 열면 로드에 실패합니다. editing이 된 뒤에 엽니다.원본이 없거나 복제할 수 없는 프로젝트, 같은 원본의 복제가 이미 진행 중인 경우는 응답 전에 걸러져 404나 409로 옵니다. 같은 원본의 복제 중복을 막는 잠금은 202를 보내기 전에 잡히고, 파일 복사가 끝나면 풀립니다. 응답 뒤의 복사 단계에서 실패하면 따로 알리지 않습니다.
완료 콜백
callback_url을 주면 복제가 끝났을 때 그 주소로 JSON body를 POST합니다.
{
"partner_code": "sandbox",
"org_project_id": "-LiBngTbCFYNjcOVcxcY",
"new_project_id": "-LEnOT7xY0ZJgXAVfc0p",
"src_partner_user_id": "sandbox-kr46KCD8vWOnOGo8CBO7c6ctSge2",
"dst_partner_user_id": "sandbox-kr46KCD8vWOnOGo8CBO7c6ctSge2",
"preview_tns": [{ "url": "https://.../1.jpg" }]
}
콜백을 받는 쪽은 20초 안에 2xx와 JSON body로 응답해야 합니다. 그렇지 않으면 실패로 보고 20초 간격으로 최대 3번 더 보냅니다. 복사 단계에서 실패하면 콜백이 오지 않으므로, 콜백을 기다리는 쪽은 타임아웃을 두고 프로젝트 상태를 조회합니다.
POST
/
v2
/
projects
/
{project_id}
/
clone_async
프로젝트 복제 (비동기)
curl --request POST \
--url https://api.edicus.io/v2/projects/{project_id}/clone_async \
--header 'Content-Type: application/json' \
--header 'edicus-api-key: <api-key>' \
--header 'edicus-uid: <edicus-uid>' \
--data '
{
"callback_url": "https://partner.example.com/edicus/clone-done"
}
'import requests
url = "https://api.edicus.io/v2/projects/{project_id}/clone_async"
payload = { "callback_url": "https://partner.example.com/edicus/clone-done" }
headers = {
"edicus-uid": "<edicus-uid>",
"edicus-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'edicus-uid': '<edicus-uid>',
'edicus-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({callback_url: 'https://partner.example.com/edicus/clone-done'})
};
fetch('https://api.edicus.io/v2/projects/{project_id}/clone_async', 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_async",
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([
'callback_url' => 'https://partner.example.com/edicus/clone-done'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.edicus.io/v2/projects/{project_id}/clone_async"
payload := strings.NewReader("{\n \"callback_url\": \"https://partner.example.com/edicus/clone-done\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("edicus-uid", "<edicus-uid>")
req.Header.Add("edicus-api-key", "<api-key>")
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://api.edicus.io/v2/projects/{project_id}/clone_async")
.header("edicus-uid", "<edicus-uid>")
.header("edicus-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"callback_url\": \"https://partner.example.com/edicus/clone-done\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.edicus.io/v2/projects/{project_id}/clone_async")
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>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"callback_url\": \"https://partner.example.com/edicus/clone-done\"\n}"
response = http.request(request)
puts response.read_body{
"project_id": "-LEnOT7xY0ZJgXAVfc0p"
}Headers
Path Parameters
Body
application/json