Program - OgnianApostolov/builderly-api-docs GitHub Wiki
Model
Program program {
"_id": {
"autogenerated": "true"
},
"title": {
"type": "string"
},
"url": {
"type": "string",
"unique": "true",
"required": "true"
},
"static_url": {
"type": "string"
},
"header": {
"type": "string"
},
"body": {
"type": "string"
},
"medias": [{
"media": {
"type": "Media._ObjectId"
}
}],
"video": {
"ref": "Video._ObjectId",
},
"about_page": {
"ref": "AboutPages._ObjectId",
},
"weeks": [{
"isCompleted":{
"virtual": "true"
},
"progress": {
"virtual": "true"
},
"title": {
"type": "String"
},
"days": [{
"isCompleted":{
"virtual": "true"
},
"progress": {
"virtual": "true"
},
"title": {
"type": "string"
},
"steps": [{
"title": {
"type": "string",
"required": "true"
},
"body": {
"type": "string",
"required": "true"
},
"video": {
"ref": "Video._ObjectId",
},
"medias": [{
"media": {
"type": "Media._ObjectId"
}
}],
"about_page": {
"ref": "AboutPage._ObjectId",
}
}]
}]
}],
"suitability_price_plans": [{
"ref": "PricePlan._ObjectId",
}],
"isSuitable": {
"type": "boolean"
},
"popup": {
"title": {
"type": "string"
},
"points:" {
"type": ["string"]
}
},
"price": {
"type": "number",
"default": 0
},
"collection_id": {
"ref": "Collection._ObjectId",
},
"topics": [{
"collection_id": {
"ref": "Collection._ObjectId",
}
}],
"owner_id": {
"ref": "User._ObjectId",
"required": "true"
},
"ribbon": {
"type": "string"
},
"striked:" {
"type": "string"
},
"isConsistent": {
"type": "boolean",
"default": "false"
},
"wildcard_url": {
"virtual": "true"
}
"createdAt": {
"autogenerated": "true"
},
"updatedAt": {
"autogenerated": "true"
}
}
Methods
Create new
POST /programs
req.body required
method: 'POST'
{
url: 'https://{{your-builderly-domain}}/programs,
headers: {
'Authorization': 'Bearer ' + token
},
json: true,
body: {}
}
Responses
Success - status 201
{}
Error - status 400
{
error_message
}
Retrieve multiple
GET /programs?ionic=true
method: 'GET'
{
url: 'https://{{your-builderly-domain}}/programs?ionic=true',
headers: {},
json: true,
body: {}
}
Responses
Success - status 200
[
{
programs,
filters,
advanced_filters,
additionalFieldsLocales,
selected_filters,
showSortByPrice,
about_page,
site_name
}
]
Error - status 500
{
error_message
}
Not found - status 404
{}
Query parameters:
- sortBy
createdAt:-1
(most recent) - used by defaultcreatedAt:1
(least recent)custom_1:-1
(custom_field_1 by ascending)custom_1:1
(custom_field_1 by descending)custom_2:-1
(custom_field_2 by ascending)custom_2:1
(custom_field_2 by descending)custom_3:-1
(custom_field_3 by ascending)custom_3:1
(custom_field_3 by descending) - collection
programs/{{your-program-name}}
- Example usages:
/programs?ionic=true&collection=programs?sortBy=createdAt:-1
- Get blog programs from collection sort by newest./programs?ionic=true
- Get all programs
Retrieve single
GET /programs/:url?ionic=true
method: 'GET'
{
url: 'https://{{your-builderly-domain}}/programs/{{program.url}}?ionic=true',
headers: {},
json: true,
body: {}
}
Responses
Success - status 200
{
programs,
filters,
advanced_filters,
additionalFieldsLocales,
selected_filters,
showSortByPrice,
about_page,
site_name
}
Not found - status 404
{}
Error - status 500
{
error_message
}
- Example usages:
/programs/:url?ionic=true
- Retrives a specific program
Update single
PATCH /programs/:id
method: 'PATCH'
{
url: 'https://{{your-builderly-domain}}/programs/{{program._id}}',
headers: {
'Authorization': 'Bearer ' + token
},
json: true,
body: {}
}
Responses
Success - status 200
{ program }
Error - status 400
{
error_message
}
Not found - status 404
{}
Delete single
DELETE /programs/:id?
method: 'DELETE'
{
url: 'https://{{your-builderly-domain}}/programs/{{program._id}}',
headers: {
'Authorization': 'Bearer ' + token
},
json: true,
body: {}
}
Responses
Success - status 200
{ program }
Not found - status 404
{}
Error - status 500
{
error_message
}