Code Storefronts
Replace code storefront source from a ZIP archive
Developer API operation for PUT /dev/v1/code-storefronts//source/archive.
PUT
/
dev
/
v1
/
code-storefronts
/
{id}
/
source
/
archive
Replace code storefront source from a ZIP archive
curl --request PUT \
--url https://api.shoppex.io/dev/v1/code-storefronts/{id}/source/archive \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form archive='@example-file' \
--form 'expected_source_revision=<string>'const form = new FormData();
form.append('archive', '<string>');
form.append('expected_source_revision', '<string>');
const options = {method: 'PUT', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.shoppex.io/dev/v1/code-storefronts/{id}/source/archive', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.shoppex.io/dev/v1/code-storefronts/{id}/source/archive"
files = { "archive": ("example-file", open("example-file", "rb")) }
payload = { "expected_source_revision": "<string>" }
headers = {"Authorization": "Bearer <token>"}
response = requests.put(url, data=payload, files=files, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.shoppex.io/dev/v1/code-storefronts/{id}/source/archive",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"archive\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"expected_source_revision\"\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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.shoppex.io/dev/v1/code-storefronts/{id}/source/archive"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"archive\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"expected_source_revision\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": {}
}Authorizations
Use your Shoppex API key in the Authorization header.
Path Parameters
Body
multipart/form-data
Response
200 - application/json
Successful response
Previous
Enqueue code storefront buildDeveloper API operation for POST /dev/v1/code-storefronts/{id}/builds.
Next
⌘I
Replace code storefront source from a ZIP archive
curl --request PUT \
--url https://api.shoppex.io/dev/v1/code-storefronts/{id}/source/archive \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form archive='@example-file' \
--form 'expected_source_revision=<string>'const form = new FormData();
form.append('archive', '<string>');
form.append('expected_source_revision', '<string>');
const options = {method: 'PUT', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.shoppex.io/dev/v1/code-storefronts/{id}/source/archive', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.shoppex.io/dev/v1/code-storefronts/{id}/source/archive"
files = { "archive": ("example-file", open("example-file", "rb")) }
payload = { "expected_source_revision": "<string>" }
headers = {"Authorization": "Bearer <token>"}
response = requests.put(url, data=payload, files=files, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.shoppex.io/dev/v1/code-storefronts/{id}/source/archive",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"archive\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"expected_source_revision\"\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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.shoppex.io/dev/v1/code-storefronts/{id}/source/archive"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"archive\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"expected_source_revision\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": {}
}