api doc edits and adding google site verification file

This commit is contained in:
Martina 2021-07-30 15:00:06 -07:00
parent a66fad2942
commit 10c663e7a5
16 changed files with 39 additions and 41 deletions

View File

@ -118,7 +118,7 @@ const response = await fetch("https://slate.host/api/v1/get", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Basic XXX-YOUR-SLATE-KEY-XXX",
Authorization: "XXX-YOUR-SLATE-KEY-XXX",
},
});
```

View File

@ -9,9 +9,9 @@ const getTime = () => {
const SLATE = "SLATE ";
export const error = (...message) => {
console.log(`\x1b[1m[ \x1b[31m${SLATE}\x1b[0m\x1b[1m ]\x1b[0m ${getTime()} `, ...message);
console.error(`\x1b[1m[ \x1b[31m${SLATE}\x1b[0m\x1b[1m ]\x1b[0m ${getTime()} `, ...message);
};
export const log = (...message) => {
console.log(`\x1b[1m[ \x1b[32m${SLATE}\x1b[0m\x1b[1m ]\x1b[0m ${getTime()} `, ...message);
console.info(`\x1b[1m[ \x1b[32m${SLATE}\x1b[0m\x1b[1m ]\x1b[0m ${getTime()} `, ...message);
};

View File

@ -10,7 +10,7 @@ const EXAMPLE_CODE_JS = (
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: 'Basic ${key}',
Authorization: '${key}',
},
body: JSON.stringify({ data: {
id: '${slateId}' // collection ID
@ -35,7 +35,7 @@ import json as JSON
url = 'https://slate.host/api/v1/get-slate'
headers = {
'content-type': 'application/json',
'Authorization': 'Basic ${key}'
'Authorization': '${key}'
}
json = {

View File

@ -7,7 +7,7 @@ const EXAMPLE_CODE_JS = (key) => `const response = await fetch('https://slate.ho
method: 'GET',
headers: {
'Content-Type': 'application/json',
Authorization: 'Basic ${key}',
Authorization: '${key}',
},
body: JSON.stringify({ data: {
private: false // set private = true to include private collections
@ -38,7 +38,7 @@ import json as JSON
url = "https://slate.host/api/v1/get"
headers = {
"content-type": "application/json",
"Authorization": "Basic ${key}",
"Authorization": "${key}",
}
json = {

View File

@ -15,7 +15,7 @@ const response = await fetch('https://slate.host/api/v1/update-slate', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: 'Basic ${key}', // API key
Authorization: '${key}', // API key
},
body: JSON.stringify({ data: collection })
});`;
@ -26,7 +26,7 @@ const EXAMPLE_CODE_PY = (key, slateId) =>
headers = {
"content-type": "application/json",
"Authorization": "Basic ${key}", # API key
"Authorization": "${key}", # API key
}
json = { "id": "${slateId}" } # slate ID

View File

@ -12,7 +12,7 @@ data.append("data", file);
const response = await fetch(url, {
method: 'POST',
headers: {
Authorization: 'Basic ${key}', // API key
Authorization: '${key}', // API key
},
body: data
});`;
@ -24,7 +24,7 @@ files = {
"file": open("example-file.txt", "rb")
}
headers = {
"Authorization": "Basic ${key}" # API key
"Authorization": "${key}" # API key
}
r = requests.post(url, headers=headers, files=files)`;
@ -41,7 +41,7 @@ data.append("data", file);
const response = await fetch(url, {
method: 'POST',
headers: {
Authorization: 'Basic ${key}', // API key
Authorization: '${key}', // API key
},
body: data
});`;
@ -53,7 +53,7 @@ files = {
"file": open("example-file.txt", "rb")
}
headers = {
"Authorization": "Basic ${key}" # API key
"Authorization": "${key}" # API key
}
r = requests.post(url, headers=headers, files=files)`;

View File

@ -10,7 +10,7 @@ const EXAMPLE_CODE_JS = (
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: 'Basic ${key}',
Authorization: '${key}',
},
body: JSON.stringify({ data: {
id: '${slateId}' // collection ID
@ -35,7 +35,7 @@ import json as JSON
url = 'https://slate.host/api/v2/get-collection'
headers = {
'content-type': 'application/json',
'Authorization': 'Basic ${key}'
'Authorization': '${key}'
}
json = {

View File

@ -10,7 +10,7 @@ const EXAMPLE_CODE_JS = (
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: 'Basic ${key}',
Authorization: '${key}',
},
body: JSON.stringify({ data: {
id: '${userId}' // user ID
@ -35,7 +35,7 @@ import json as JSON
url = 'https://slate.host/api/v2/get-user'
headers = {
'content-type': 'application/json',
'Authorization': 'Basic ${key}'
'Authorization': '${key}'
}
json = {

View File

@ -7,7 +7,7 @@ const EXAMPLE_CODE_JS = (key) => `const response = await fetch('https://slate.ho
method: 'GET',
headers: {
'Content-Type': 'application/json',
Authorization: 'Basic ${key}',
Authorization: '${key}',
}
});
@ -30,7 +30,7 @@ import json as JSON
url = "https://slate.host/api/v2/get"
headers = {
"content-type": "application/json",
"Authorization": "Basic ${key}",
"Authorization": "${key}",
}
r = requests.get(url, headers=headers)

View File

@ -16,10 +16,11 @@ const response = await fetch('https://slate.host/api/v2/update-file', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: 'Basic ${key}', // API key
Authorization: '${key}', // API key
},
body: JSON.stringify({ data: file })
});`;
});
const json = await response.json();`;
};
const EXAMPLE_CODE_PY = (key, slateId) =>
@ -27,7 +28,7 @@ const EXAMPLE_CODE_PY = (key, slateId) =>
headers = {
"content-type": "application/json",
"Authorization": "Basic ${key}", # API key
"Authorization": "${key}", # API key
}
json = { "id": "${slateId}" } # collection ID

View File

@ -15,10 +15,11 @@ const response = await fetch('https://slate.host/api/v2/update-collection', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: 'Basic ${key}', // API key
Authorization: '${key}', // API key
},
body: JSON.stringify({ data: collection })
});`;
});
const json = await response.json();`;
};
const EXAMPLE_CODE_PY = (key, slateId) =>
@ -26,7 +27,7 @@ const EXAMPLE_CODE_PY = (key, slateId) =>
headers = {
"content-type": "application/json",
"Authorization": "Basic ${key}", # API key
"Authorization": "${key}", # API key
}
json = { "id": "${slateId}" } # collection ID

View File

@ -12,7 +12,7 @@ data.append("data", file);
const response = await fetch(url, {
method: 'POST',
headers: {
Authorization: 'Basic ${key}', // API key
Authorization: '${key}', // API key
},
body: data
});`;
@ -24,7 +24,7 @@ files = {
"file": open("example-file.txt", "rb")
}
headers = {
"Authorization": "Basic ${key}" # API key
"Authorization": "${key}" # API key
}
r = requests.post(url, headers=headers, files=files)`;
@ -41,10 +41,11 @@ data.append("data", file);
const response = await fetch(url, {
method: 'POST',
headers: {
Authorization: 'Basic ${key}', // API key
Authorization: '${key}', // API key
},
body: data
});`;
});
const json = await response.json();`;
const SLATE_EXAMPLE_CODE_PY = (key, slateId) => `import requests
@ -53,7 +54,7 @@ files = {
"file": open("example-file.txt", "rb")
}
headers = {
"Authorization": "Basic ${key}" # API key
"Authorization": "${key}" # API key
}
r = requests.post(url, headers=headers, files=files)`;

View File

@ -211,11 +211,8 @@ const NewWebsitePrototypeHeader = (props) => {
</a>
</div>
<div css={STYLES_RIGHT}>
<a css={STYLES_LINK} style={{ marginRight: 24 }} href={communityURL}>
Get involved
</a>
<a css={STYLES_LINK} href={signInURL}>
Sign in
Use Slate
</a>
</div>
<div css={STYLES_MOBILENAV}>
@ -224,11 +221,8 @@ const NewWebsitePrototypeHeader = (props) => {
<div css={STYLES_BURGER_BUN2} style={styleBurgerBun2} />
</div>
<div css={STYLES_MENU} style={styleMenu}>
<a css={STYLES_NAVLINK} style={styleNavLink} href={communityURL}>
Get involved
</a>
<a css={STYLES_NAVLINK} style={styleNavLink} href={signInURL}>
Sign in
Use Slate
</a>
</div>
</div>

View File

@ -0,0 +1 @@
google-site-verification: google75364ba6a57d7b7d.html

View File

@ -18,7 +18,7 @@ export default class SlateReactSystemPage extends React.Component {
const url = "/api/v1/get";
const response = await fetch(url, {
headers: {
Authorization: "Basic SLA85621d2d-1bc1-4c35-9e3a-1e43689c155fTE",
Authorization: "SLA85621d2d-1bc1-4c35-9e3a-1e43689c155fTE",
},
});
@ -36,7 +36,7 @@ export default class SlateReactSystemPage extends React.Component {
const response = await fetch(url, {
method: "POST",
headers: {
Authorization: "Basic --",
Authorization: "--",
},
body: data,
});

View File

@ -725,7 +725,7 @@ method: 'POST',
headers: {
'Content-Type': 'application/json',
// NOTE: your API key
Authorization: 'Basic SLATE-API-KEY-FROM-ACCOUNT-SETTINGS',
Authorization: 'SLATE-API-KEY-FROM-ACCOUNT-SETTINGS',
},
body: JSON.stringify({ data: {
// NOTE: optional, if you want your private collections too.