Skip to content

Commit

Permalink
updated v2 upload docs to use v2 endpoint instead of v1
Browse files Browse the repository at this point in the history
  • Loading branch information
martinalong committed Sep 15, 2021
1 parent d0341d2 commit a26630e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions components/api-docs/v2/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as System from "~/components/system";

import CodeBlock from "~/components/system/CodeBlock";

const EXAMPLE_CODE_JS = (key) => `const url = 'https://uploads.slate.host/api/public';
const EXAMPLE_CODE_JS = (key) => `const url = 'https://uploads.slate.host/api/v2/public';
let file = e.target.files[0];
let data = new FormData();
Expand All @@ -19,7 +19,7 @@ const response = await fetch(url, {

const EXAMPLE_CODE_PY = (key) => `import requests
url = "https://uploads.slate.host/api/public"
url = "https://uploads.slate.host/api/v2/public"
files = {
"file": open("example-file.txt", "rb")
}
Expand All @@ -32,7 +32,7 @@ r = requests.post(url, headers=headers, files=files)`;
const SLATE_EXAMPLE_CODE_JS = (
key,
slateId
) => `const url = 'https://uploads.slate.host/api/public/${slateId}'; // collection ID
) => `const url = 'https://uploads.slate.host/api/v2/public/${slateId}'; // collection ID
let file = e.target.files[0];
let data = new FormData();
Expand All @@ -49,7 +49,7 @@ const json = await response.json();`;

const SLATE_EXAMPLE_CODE_PY = (key, slateId) => `import requests
url = "https://uploads.slate.host/api/public/${slateId}" # collection ID
url = "https://uploads.slate.host/api/v2/public/${slateId}" # collection ID
files = {
"file": open("example-file.txt", "rb")
}
Expand Down

0 comments on commit a26630e

Please sign in to comment.