Generate embed code for component
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
userId: '<string>',
groupIds: ['class-101', 'class-102'],
sessionId: '<string>',
theme: {
primaryColor: '<string>',
secondaryColor: '<string>',
backgroundColor: '<string>',
textColor: '<string>',
fontFamily: '<string>',
fontSize: '<string>',
borderRadius: '<string>',
padding: '<string>',
logoUrl: '<string>',
hideBranding: true
},
width: '<string>',
height: '<string>',
expiryHours: 1
})
};
fetch('https://studyfetchapi.com/api/v1/components/{id}/embed', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://studyfetchapi.com/api/v1/components/{id}/embed \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"userId": "<string>",
"groupIds": [
"class-101",
"class-102"
],
"sessionId": "<string>",
"theme": {
"primaryColor": "<string>",
"secondaryColor": "<string>",
"backgroundColor": "<string>",
"textColor": "<string>",
"fontFamily": "<string>",
"fontSize": "<string>",
"borderRadius": "<string>",
"padding": "<string>",
"logoUrl": "<string>",
"hideBranding": true
},
"width": "<string>",
"height": "<string>",
"expiryHours": 1
}
'import requests
url = "https://studyfetchapi.com/api/v1/components/{id}/embed"
payload = {
"userId": "<string>",
"groupIds": ["class-101", "class-102"],
"sessionId": "<string>",
"theme": {
"primaryColor": "<string>",
"secondaryColor": "<string>",
"backgroundColor": "<string>",
"textColor": "<string>",
"fontFamily": "<string>",
"fontSize": "<string>",
"borderRadius": "<string>",
"padding": "<string>",
"logoUrl": "<string>",
"hideBranding": True
},
"width": "<string>",
"height": "<string>",
"expiryHours": 1
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"embedUrl": "<string>",
"token": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"componentId": "<string>",
"componentType": "<string>",
"options": {
"width": "<string>",
"height": "<string>"
}
}Components
Generate embed code for component
POST
/
api
/
v1
/
components
/
{id}
/
embed
Generate embed code for component
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
userId: '<string>',
groupIds: ['class-101', 'class-102'],
sessionId: '<string>',
theme: {
primaryColor: '<string>',
secondaryColor: '<string>',
backgroundColor: '<string>',
textColor: '<string>',
fontFamily: '<string>',
fontSize: '<string>',
borderRadius: '<string>',
padding: '<string>',
logoUrl: '<string>',
hideBranding: true
},
width: '<string>',
height: '<string>',
expiryHours: 1
})
};
fetch('https://studyfetchapi.com/api/v1/components/{id}/embed', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://studyfetchapi.com/api/v1/components/{id}/embed \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"userId": "<string>",
"groupIds": [
"class-101",
"class-102"
],
"sessionId": "<string>",
"theme": {
"primaryColor": "<string>",
"secondaryColor": "<string>",
"backgroundColor": "<string>",
"textColor": "<string>",
"fontFamily": "<string>",
"fontSize": "<string>",
"borderRadius": "<string>",
"padding": "<string>",
"logoUrl": "<string>",
"hideBranding": true
},
"width": "<string>",
"height": "<string>",
"expiryHours": 1
}
'import requests
url = "https://studyfetchapi.com/api/v1/components/{id}/embed"
payload = {
"userId": "<string>",
"groupIds": ["class-101", "class-102"],
"sessionId": "<string>",
"theme": {
"primaryColor": "<string>",
"secondaryColor": "<string>",
"backgroundColor": "<string>",
"textColor": "<string>",
"fontFamily": "<string>",
"fontSize": "<string>",
"borderRadius": "<string>",
"padding": "<string>",
"logoUrl": "<string>",
"hideBranding": True
},
"width": "<string>",
"height": "<string>",
"expiryHours": 1
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"embedUrl": "<string>",
"token": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"componentId": "<string>",
"componentType": "<string>",
"options": {
"width": "<string>",
"height": "<string>"
}
}Authorizations
API Key for server-to-server authentication. Resolves to the owning organization.
Path Parameters
Component ID
Body
application/json
User ID for tracking
Group IDs for collaboration
Example:
["class-101", "class-102"]
Session ID for continuity
Theme customization
Show child attributes
Show child attributes
Feature toggles
Show child attributes
Show child attributes
Embed width (e.g., "100%", "600px")
Embed height (e.g., "400px", "100vh")
Token expiry time in hours
Response
200 - application/json
Embed code generated successfully
The embed URL for iframe integration
JWT token for authentication
Token expiration timestamp
Component ID
Component type
Embed options
Show child attributes
Show child attributes
Was this page helpful?