Get Started
In this guide, you are going to learn how to interact with sections as a frontend developer. If you are a vueJS dev you can use our ready made vue-sections library.
If you wish to create your own client implementation, keep reading.
Step 1: Register here to get your project_id
.
Step 2: With your project_id
you can start requesting sections yet to create pages and add content to them you need an access token. Read below to understand how to get an access token for your project.
Note: All requests that are secured by a Section token is subject to CORS verification
API's base URL is https://sections.geeks.solutions
Models
Dashboard
Dashboard information returned that conveys package limitations and current consumption
{
"package_name": "free",
"package_locked": false,
"max_pages": 2,
"max_media_files": 10,
"max_file_size": 500000,
"current_pages": 0,
"current_medias": 0,
"api_until_reset": 46674951,
"api_limit_use": 500,
"api_current_use": 0
}
Property | Description | Type | Required |
---|---|---|---|
api_current_use | current rate limtied requests ina specific day | boolean | true |
api_limit_use | Maximum allowed rate-limited requests in a specific day - Package limitation | string | true |
api_until_reset | Timestamp in milliseconds until the API rate-limited consumption is reset | integer | true |
current_medias | Count of total files currently present linked to pages of this project. | integer | true |
current_pages | Count of number of pages currently created in the project. | integer | true |
max_file_size | Maximum allowed file size (in bytes) that can be used in pages of this project - Package limitation. | integer | true |
max_media_files | Maximum allowed files that can be present linked to pages of this project - Package limitation. | integer | false |
max_pages | Maximmum number of pages that can be created in the project. - Package limitation | integer | true |
package_locked | The package's locked status the project is subscribed to. | boolean | true |
package_name | The package's name the project is subscribed to. | string | true |
Error
Errors returned by sections
{
"error": "Section type already exists"
}
Property | Description | Type | Required |
---|---|---|---|
error | Description of the error | string | false |
Invitation
This is the response of the invitation API call.
{
"invited": [
"email1@gmail.com",
"email2@gmail.com"
],
"failed_to_send": [
"email3@gmail.com"
],
"demotion": [
"superiorrole@gmail.com"
]
}
Property | Description | Type | Required |
---|---|---|---|
demotion | List of emails that are already in the project and have a superior role to the invitation one. | array(any) | false |
failed_to_send | List of failed invitation emails | array(any) | false |
invited | List of successfully invited emails | array(any) | false |
Media
A media is an entity that presents a file in Sections
{
"type": "image",
"seo_tag": "",
"private_status": "public",
"number_of_contents": 1,
"namespace": "608c0177d66ef2000836a374",
"locked_status": "unlocked",
"id": "613874bc0a998613c74b338c",
"files": [
{
"url": "https://s3.amazonaws.com/eweevtestbucketprivate/sections%2Fa5ac5bc7e6d643f89a4f15c4d8f29aec89ba3988ab904d6aae5934719d4df19a.png",
"type": "image/png",
"thumbnail_url": "https://s3.amazonaws.com/eweevtestbucketprivate/sections%2Fa5ac5bc7e6d643f89a4f15c4d8f29aec89ba3988ab904d6aae5934719d4df19a_thumbnail.png",
"size": 25442,
"platform_id": "611610df0a998615afb99c29",
"filename": "sections/a5ac5bc7e6d643f89a4f15c4d8f29aec89ba3988ab904d6aae5934719d4df19a.png",
"file_id": "ac411a0825cd280cc219844bf3b64271-12de37"
}
],
"contents_used": [
"60cb6953d66ef20008ae2177"
],
"author": "60cb6953d66ef20008ae2177"
}
Property | Description | Type | Required |
---|---|---|---|
author | The author of the media | string | false |
contents_used | List of pages related to this media | array(any) | false |
files | List of files | array(any) | true |
id | Unique identifier | string | true |
locked_status | unlocked media can be edited by any user in the project. locked medias can only be edited by their author |
string | false |
namespace | The project id using this media | string | false |
number_of_contents | The number of contents referencing this media | integer | false |
private_status | public files are accessible by anyone, private files requires an STS token to be viewed |
string | false |
seo_tag | Image Alt tag used for SEO | string | false |
type | Media type (image, video..) | string | false |
Message
A confirmation message back to the user upon successfull action
{
"message": "Section type deleted succesfully"
}
Property | Description | Type | Required |
---|---|---|---|
message | a message | string | false |
Options
Options returned by third party applications for a configurable section type
[
{
"option_values": [
1,
2,
3
],
"field": "article_ids"
}
]
Property | Description | Type | Required |
---|---|---|---|
error | Array of options with their possible values | array(any) | false |
Package
A package is the subscription of your project in section. It represents what the project is offered in term of resources.
{
"type": "public",
"rank": 1,
"quota": -1,
"price": 1700,
"name": "solo",
"locked": false,
"limits": [
{
"value": 5,
"name": "number_of_pages",
"label": "Max number of pages"
},
{
"value": 3,
"name": "variation_per_page",
"label": "Max number of variation per page"
},
{
"value": 20,
"name": "static_sections",
"label": "Max number of static section types that can be declared"
},
{
"value": 10,
"name": "sections_total",
"label": "Max number of sections per page"
},
{
"value": 100,
"name": "hosted_files",
"label": "Max number of files hosted"
},
{
"value": 1000000,
"name": "size_per_file",
"label": "Maximum Size Per File (in bytes)"
},
{
"value": -1,
"name": "api_limit_sec",
"label": "API rate limit per sec"
},
{
"value": -1,
"name": "api_limit_minute",
"label": "API rate limit per minute"
},
{
"value": 500,
"name": "api_limit_hour",
"label": "API rate limit per hour"
},
{
"value": 1000,
"name": "api_limit_day",
"label": "API rate limit per day"
}
],
"label": "Standard"
}
Property | Description | Type | Required |
---|---|---|---|
id | Unique identifier | string | true |
label | The title of the package | string | false |
limits | A list of limits, it shows up to how much resources can your project consume | array(any) | false |
locked | Whether this package is locked and can receive new subscriptions or not | boolean | false |
name | Unique name of the package | string | false |
price | The price of the package in cents (ie 10,50€ is returned as 1050) | integer | false |
quota | The number of projects allowed to use this package at any given time. -1 for unlimited | integer | false |
rank | The package rank used to identify upgrades/downgrades between packages | integer | false |
type | The type of the package could be private or a public one. | string | false |
Page
A page is layout of different sections grouped together.
{
"variations": [
"variation-1",
"variation-2"
],
"settings": [
{
"weight": 1,
"type": "dynamic",
"region": "bottom-left",
"name": "blogs:categories_articles",
"id": "123456789123456789123456"
}
],
"project_id": "5fe309f42a4e7d91aad8964f",
"page": "home_page",
"layout": "layout1"
}
Property | Description | Type | Required |
---|---|---|---|
id | Unique identifier | string | true |
layout | The layout title | string | false |
metadata | An object containing the metadata of your page | map | false |
page | Name of the page | string | true |
path | The path under your domain to access your page, it has to be unique per project. Equals to your page name if empty | string | true |
render_data | Data requested by the front end developer that he will use to render the content needed. | string | false |
settings | List of sections that are included in the page | array(any) | false |
variations | A variations for the page | string | false |
Pending_Invitation
This is the response of the get pending_invitation API call.
{
"users": [
{
"role": "webmaster",
"invited_at": 1652524584,
"email": "email@gmail.com"
}
],
"total": 1
}
Property | Description | Type | Required |
---|---|---|---|
total | Total of pending invitations | integer | false |
users | List of pending invitations | array(any) | false |
Project
A Project that a user owns in sections it contains the project credentials and configurations
{
"type": "private",
"project_url": [
"https://your.project.url.com"
],
"private_key": "xxxxxx",
"package": "free",
"login_redirect_url": "https://your.project.url.com/redirect_login/admin",
"id": "601bf1221907a50007ba3f81",
"files_counter": 0,
"configured_fields": {
"blogs ": {
"project_id": 1,
"private_key": "xxxxxx"
}
},
"active": true
}
Property | Description | Type | Required |
---|---|---|---|
active | The status of the project | boolean | false |
billing_status | The Billing status of the project, can be any of upgrade_lock or upgradeable . |
||
This is automatically set based on your company solvency status. | string | false | |
configured_fields | A list of object (maps) that indicates the configured fields of the third party apps for this project | array(any) | false |
id | Unique identifier | string | true |
limitation_status | The Limitation status of the project, can be any of active , degraded or blocked . |
||
This is automatically set based on your invoice payment status. | string | false | |
login_redirect_url | The URL Sections redirects connected user to with the auth code to issue a valid access token. | string | false |
package | The current subscription of the project | string | false |
project_url | The list of base URLs of the project, used to pass CORS. You are allowed to use localhost in the list, as long as you specify the port.Local network IP Addreses are also allowed, only on HTTP and by specifying the port as well. | array(any) | false |
reason | The reason of inactivity in case the project is inactive | string | false |
type | The type of the project can be public or private | string | false |
Section_Type
A Section Type in Sections
{
"type": "static",
"name": "private_static",
"multiple": false,
"id": "60195bbd2a4e7df7496d9740",
"fields": "null",
"dynamic_options": false,
"application": "sections",
"access": "private"
}
Property | Description | Type | Required |
---|---|---|---|
access | The access to the section type | string | false |
application | application that declared the section type | string | false |
authorization_fields | Used for third party integration to authorize the use who is asking for the section type | map | false |
fields | Used for configurable Section Types fields that can be chosen to render | map | false |
id | Unique identifier | string | true |
name | Section type's name | string | false |
options | Used for configurable Section Types options | map | false |
region | The region of the layout that section type will be rendered into default to {}. | map | false |
requirements | Shows the required fields for a public scoped section type. | array(any) | false |
status | Shows the status for a public scoped section type. | string | false |
type | The type of the sections i.e. static, local, configurable or dynamic | string | false |
weight | The weight of the section type on the layout which means the order | integer | false |
Token
Certain API calls are secured with an access token, read below about authentication to know how to get an access token for your application
{
"token": "A really long string"
}
Property | Description | Type | Required |
---|---|---|---|
token | An authentication token | string | false |
User
This is Section's user model. It contains all the information that sections needs to know about you.
{
"token": "A really long string"
}
Property | Description | Type | Required |
---|---|---|---|
Users email | string | false | |
roles | DEPRECATED. A list, contains the roles' IDS. | array(any) | false |
roles_object | A lsit of objects. Each object contains the role title and id. These are the roles that are assigned tot he user. | array(any) | false |
saas_project_id | The section project to which the user is linked to. | string | false |
1. Authentication
In order to issue secured api calls to sections you need an access token, to simplify the generation of such token we implemented a simple flow.
When you register or login successfully you will get redirected to the back office page of your project where you see your project information.
There is a field named Login Redirect Url
you should populate it with the URL of a page on your project where you will run the Access Token retrieval code.
Next to the field, there is a button called Connect to your app with your sections credentials
. When clicking this button you will get redirected to your website with an auth_code
in the query string. This auth code is required to retrieve your access token from sections in the Get Access Token request.
Once you retrieve your token you have to include it in :ratethe header of the secured requests.
Get access token
Valid auth code/
GET /api/v1/project/66ec5f73c05af802fdeab735/token/96F424098AFFE9BA08DC07FD63C2457F
origin: http://bfc5cd5d-8add-49c3-9c7e-5a854a79aaaf.com
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbHcDbmlsbQAAAA9zYWFzX3Byb2plY3RfaWRsAAAAAXQAAAACbQAAAARyb2xlbQAAAAR1c2VybQAAAA9zYWFzX3Byb2plY3RfaWRtAAAAGDY2ZWM1ZjczYzA1YWY4MDJmZGVhYjczNWptAAAABnN0YXR1c20AAAAIdmVyaWZpZWRtAAAAB3VzZXJfaWRtAAAAIDY0N2M4YjE0YzI4ZTRkYmNhOTY0ZWU5YmMyYzQzMGE5bQAAAAZzdGF0dXNtAAAAB3N1Y2Nlc3NuBgAn3FQLkgFiAAFRgA.Yi2usYNf4BQWGN5RzQWP4t_mA5o_HYiXIn3ybBIHqLA
Response
200
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1Z6a_0aSucoEABEbh
content-type: application/json; charset=utf-8
access-control-allow-origin: http://bfc5cd5d-8add-49c3-9c7e-5a854a79aaaf.com
{
"token": "SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbHcDbmlsbQAAAA9zYWFzX3Byb2plY3RfaWRsAAAAAXQAAAACbQAAAARyb2xlbQAAAAR1c2VybQAAAA9zYWFzX3Byb2plY3RfaWRtAAAAGDY2ZWM1ZjczYzA1YWY4MDJmZGVhYjczNWptAAAABnN0YXR1c20AAAAIdmVyaWZpZWRtAAAAB3VzZXJfaWRtAAAAIDY0N2M4YjE0YzI4ZTRkYmNhOTY0ZWU5YmMyYzQzMGE5bQAAAAZzdGF0dXNtAAAAB3N1Y2Nlc3NuBgAn3FQLkgFiAAFRgA.Yi2usYNf4BQWGN5RzQWP4t_mA5o_HYiXIn3ybBIHqLA"
}
Use a supplied auth_code to retrieve an access token. The auth_code expires in a few seconds, if you wish to test that using an API client (i.e Postman) make sure to act quickly.
Request
GET api/v1/project/{project_id}/token/{auth_code}
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
project_id | Your project id in Sections | query_string | string | true | ||
auth_code | An authentication code that will be returned on redirection when you login/register successfully | query_string | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | section type resource | Token |
410 | Error Resource | Error |
2. Working With Pages
A page is where you organize your sections in one or more layouts. In this part you will learn how to create/update/render and delete a page. Please refer to the page models to see all fields a page can contain.
Renders a page
Get an existing page with project_id
POST /api/v1/project/66ec5f1ac05af802fdc8f630/page/page-path-1a630312-7a61-4133-bf4d-33d5def52fa1
origin: http://204fc559-d751-4bb6-af5c-e4ef005afb0d.com
user-agent: user-agent-f1664161-10f9-4e39-8ac4-696e4d2b53c2
project-id-80d59c97-a910-4eb0-b1b7-61dbfc818730: 1
content-type: multipart/mixed; boundary=plug_conn_test
Response
200
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1UxEJuwD29M8ABCgB
content-type: application/json; charset=utf-8
access-control-allow-origin: http://204fc559-d751-4bb6-af5c-e4ef005afb0d.com
{
"variations": null,
"sections": [
{
"weight": 1,
"type": "static",
"settings": {},
"render_data": "",
"region": {},
"query_string_keys": null,
"name": "section_name_6fd6d014-944e-41fb-ae26-407226d3f055",
"linked_to": "",
"id": "66ec5f1bc05af802fd37b43f",
"error": null
}
],
"path": "page-path-1a630312-7a61-4133-bf4d-33d5def52fa1",
"page": "page_c2c0859c-7734-453e-8068-2d4bdc352055",
"metadata": {},
"layout": "layout1",
"last_updated": 1726766875,
"invalid_sections": [],
"id": "66ec5f1ba3c683d5694d1605"
}
Renders a page with all the available sections declared inside.
Request
POST api/v1/project/{project_id}/page/{page_path}
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
query_string | Query Strings | body | map | false | {id: 1} | |
project_id | Your project id in Sections | query_string | string | true | ||
page_path | The page path | query_string | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | Project resource | Page |
404 | Error Resource | Error |
429 | Error Resource for rate limiting | Message |
Creates/updates a page
Create a page with valid section using medias ids
PUT /api/v1/project/66ec5f03c05af802fd00bd50/page/page_4d5807d8-02b6-43be-86d6-79ff93939fd5
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbHcDbmlsbQAAAA9zYWFzX3Byb2plY3RfaWRsAAAAAXQAAAACbQAAAARyb2xlbQAAAARVc2VybQAAAA9zYWFzX3Byb2plY3RfaWRtAAAAGDY2ZWM1ZjAzYzA1YWY4MDJmZDAwYmQ1MGptAAAABnN0YXR1c20AAAAIdmVyaWZpZWRtAAAAB3VzZXJfaWRtAAAAIDIyNjdhZTdjZjM4NDQzY2ZiZDA5ZTk2NzM1MGVmOWEybQAAAAZzdGF0dXNtAAAAB3N1Y2Nlc3NuBgAwJlMLkgFiAAFRgA.UVZk5SlfCJtUJ1jbtt6sxhj2XBAjhXOA3xpTJ4xvft4
origin: http://d44aee2c-2b0e-41e8-89c2-e1c4bb2c1259.com
content-type: multipart/mixed; boundary=plug_conn_test
{
"variations": [
"1"
],
"sections": [
{
"weight": 1,
"region": {
"layout1": {
"weight": 1,
"slot": "main"
}
},
"options": [
{
"image": {
"media_id": "66ec5f04c05af802fde50114"
}
}
],
"name": "section_name_ebce4f2f-0c53-49bc-9041-4a0fe21de64c"
}
],
"path": "my-page-path",
"metadata": {
"title": "Page Title",
"description": "Page SEO Description"
},
"layout": "layout1"
}
Response
200
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1TdxOTbCxmY8ABHMC
content-type: application/json; charset=utf-8
access-control-allow-origin: http://d44aee2c-2b0e-41e8-89c2-e1c4bb2c1259.com
{
"variations": [
"1"
],
"sections": [
{
"weight": 1,
"type": "static",
"settings": [
{
"image": {
"url": "https://www.fake-url.com/cf23f52bff8d43bcbbcacd4955c0263e",
"seo_tag": null,
"media_id": "66ec5f04c05af802fde50114"
}
}
],
"render_data": "",
"region": {
"layout1": {
"weight": 1,
"slot": "main"
}
},
"query_string_keys": null,
"name": "section_name_ebce4f2f-0c53-49bc-9041-4a0fe21de64c",
"linked_to": "",
"id": "66ec5f05c05af802fd1ce26e",
"error": null
}
],
"path": "my-page-path",
"page": "page_4d5807d8-02b6-43be-86d6-79ff93939fd5",
"metadata": {
"title": "Page Title",
"description": "Page SEO Description"
},
"layout": "layout1",
"last_updated": 1726766853,
"invalid_sections": [],
"id": "66ec5f05a3c683d5694d1234"
}
Upsert a page in your project with all the sections declared and their configuration so when rendering the page the user gets the same result.
To use a global section instance in a page you add a section object with a weight
and the name of the global section in the linked_to
field. For ex:
{
"sections": [{
"weight": 2,
"linked_to": "test"
}]
}
The content of the global instance will automatically be added to your page and any update to the global instance will be synchronized inside your page
If you wish to create an empty page, simply supply an empty sections
list in the payload.
For each section you can provide options.
In the options you can add files for you to use. In order to add a file for a static section type.
You need to add the fields that declare files in that section type. For ex:
{
"fields": [
{
"type": "image",
"name": "profile_image"
},
{
"type": "image",
"name": "cover_image"
}
]
}
Now in the options you can provide an existing media id to link to a section on a page.
"options": [{"profile_image": {"media_id": "media_id"}}]
For More details on Medias
, please head to the Medias
section below.
DEPRECATED: you can also provide the image like that:
"options": [{"profile_image": "A BASE 64 file string"}]
The base64 will be transformed into a media file on the fly. This method will be dropped in an upcoming update.
Request
PUT api/v1/project/{project_id}/page/{page_name}
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
project_id | Your project id in Sections | query_string | string | true | ||
page_name | The page name | query_string | string | true | ||
token | Sections Token | header | string | true | ||
variations | In case you need no Variations of the page send an empty list or null | body | array | true | {'variations': ['page1', 'page2']} | |
sections | List of sections that are going to be rendered in the page | body | array | true | {'sections': []} | |
layout | Layout title of the page | body | string | false | {'layout': 'main'} | |
url | Url of the page as the Path to access it (ie https://www.example.com/{url}) | body | string | true | {'url': 'my-page-url'} | |
metadata | Metadata of the page | body | map | false | {'metadata': {'title': 'My Page Title', 'description': 'SEO Description'}} |
Responses
Status | Description | Schema |
---|---|---|
200 | Project resource | Page |
401 | Error Resource | Error |
402 | Error Resource | Error |
Deletes a page
delete a page
DELETE /api/v1/project/66ec5f1fc05af802fd1808a7/page/66ec5f1fa3c683d5694d16a9
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbHcDbmlsbQAAAA9zYWFzX3Byb2plY3RfaWRsAAAAAXQAAAACbQAAAARyb2xlbQAAAARVc2VybQAAAA9zYWFzX3Byb2plY3RfaWRtAAAAGDY2ZWM1ZjFmYzA1YWY4MDJmZDE4MDhhN2ptAAAABnN0YXR1c20AAAAIdmVyaWZpZWRtAAAAB3VzZXJfaWRtAAAAIDRlMTU4NDlhNzRlMzQ0NGU4OWRjYzhkMzI0NmRkOGJlbQAAAAZzdGF0dXNtAAAAB3N1Y2Nlc3NuBgBDlFMLkgFiAAFRgA.p66H15c6TMeDibTrhs5OZtSVQbYdxHWKSqoJ4rtz7_U
origin: http://53ccee0e-0215-493b-9ed1-5689101633f1.com
Response
200
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1VCCk2PNLXuQABCth
content-type: application/json; charset=utf-8
access-control-allow-origin: http://53ccee0e-0215-493b-9ed1-5689101633f1.com
{
"message": "Successfully deleted 66ec5f1fa3c683d5694d16a9"
}
Deletes the page for your project. This call will erase all the data you have stored for the sections added in this particular page.
Request
DELETE api/v1/project/{project_id}/page/{page_id}
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true | ||
project_id | Your project id in Sections | query_string | string | true | ||
page_id | The page id in Sections | query_string | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | Project resource | Message |
401 | Error Resource | Error |
404 | Error Resource | Error |
3. Working With Section Types
### Sections supports four section types:
Local: This section type is totally declared and rendered on your frontend project. We have added support for such contents so you can blend it with the rest of section and define where in the page this content should display in between other sections. To add a local section to your page you just need to add a section object to your payload with type
local
and a name of your choice so you can then match it to the right content to render when you are to render the page to your visitor.Static: Static sections are supported out of the box. A static section is a very simple piece of content that provides a basic object storage for the frontend developer. This section can be used to store simple html, medias, DEPRECATED: images in base64 format (do not abuse it :-), or even JS/CSS code if you need to. This section is called static because from a server's perspective the content returned by this section is directly loaded from the Database with no processing, yet you can, as a frontend developer provide very dynamic end results by relying on external APIs at the javascript level (i.e facebook plugins, api request on frontend level etc...). You are just limited by your imagination here.
Dynamic: A dynamic section type is a bit more interesting as the content of such sections will be loaded dynamically server side. A dynamic section type will be declared by a backend third party and it will be called each time this section is requested for rendering.
Configurable: A configurable section is similar to a dynamic one as both have dynamic contents. The difference here is that a configurable section has options that the page editor can choose from. These options are stored in sections and provided to the third party server for rendering so you don't have to worry about that.
Accesses
Accesses to section types varies between:
Public is obviously public to anyone to use. So a public section type can be used by any user from any project. A section will be always declared private. However, only admins of sections can make a section type public. So you should ask them for that, they will review it and take action.
Private section type is only accessible by the project who declared the section type using his project_id and private key as mentioned in the
prerequisites
above. The project id and private key will be used to make sure that this private section type will only be accessible by the declarer’s project.Public scoped is a public section type that needs authorization to be used. It is accessible to anyone who is authorized to see it. So the project owner will need to pass authorization fields when rendering a public scoped section type in order to be granted the access for it. The authorization fields are per application level. So it only needs to be sent once (the first time). Then the application gains access if the authorization fields are valid.
Returns the list of section types the project owns
GET Section Types
GET /api/v1/project/66ec5f0fc05af802fd220562/section-types
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbHcDbmlsbQAAAA9zYWFzX3Byb2plY3RfaWRsAAAAAXQAAAACbQAAAARyb2xlbQAAAARVc2VybQAAAA9zYWFzX3Byb2plY3RfaWRtAAAAGDY2ZWM1ZjBmYzA1YWY4MDJmZDIyMDU2MmptAAAABnN0YXR1c20AAAAIdmVyaWZpZWRtAAAAB3VzZXJfaWRtAAAAIGU4MDdlNDM2YWI0MjRiYjM4YzQyYWQxMmFlMjFkZmMwbQAAAAZzdGF0dXNtAAAAB3N1Y2Nlc3NuBgAKU1MLkgFiAAFRgA.Sd0-8wqovvAqISf3BNw3EIFVchsYbV1_Y6lGstaNbo0
origin: http://612a44c4-cf62-43dc-9df4-133dd162ac7a.com
Response
200
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1UC3akzYz1Y0ABCBB
content-type: application/json; charset=utf-8
access-control-allow-origin: http://612a44c4-cf62-43dc-9df4-133dd162ac7a.com
{
"data": [
{
"type": "static",
"name": "wysiwyg",
"multiple": false,
"id": "66ec5f01a3c683d5694d117c",
"fields": null,
"dynamic_options": false,
"application_id": null,
"application": "sections",
"access": "public"
},
{
"type": "dynamic",
"requirements": [
"private_key",
"project_id"
],
"query_string_keys": null,
"name": "66ec5f09c05af802fdad8c02:top_articles",
"multiple": false,
"id": "66ec5f09a3c683d5694d1359",
"fields": [],
"dynamic_options": false,
"application_id": "66ec5f09c05af802fdad8c02",
"application": "66ec5f09c05af802fdad8c02",
"app_status": "disbaled",
"access": "public_scoped"
},
{
"type": "configurable",
"requirements": [
"private_key",
"project_id"
],
"query_string_keys": null,
"name": "66ec5f09c05af802fdad8c02:selective_articles",
"multiple": true,
"id": "66ec5f09a3c683d5694d135b",
"fields": [
{
"type": "integer",
"name": "articles_ids",
"key": "articles_ids"
}
],
"dynamic_options": true,
"application_id": "66ec5f09c05af802fdad8c02",
"application": "66ec5f09c05af802fdad8c02",
"app_status": "disbaled",
"access": "public_scoped"
}
]
}
Load all the section types the project has access to. This can be custom static section types, private section types or public ones exposed by other backend third party developers. For section types with public scoped access you can know their status and required fields in this call also the application id to which they belong. This is helpful for updating your security fields for the considered application.
Request
GET api/v1/project/{project_id}/section-types
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true | ||
project_id | Your project id in Sections | query_string | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | List of section types resource | Section_Type |
401 | Error Resource | Error |
Edits a global section instance
Edit a global Section instance
PUT /api/v1/project/66ec5f0bc05af802fded83a9/global-instances/global_section
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbHcDbmlsbQAAAA9zYWFzX3Byb2plY3RfaWRsAAAAAXQAAAACbQAAAARyb2xlbQAAAARVc2VybQAAAA9zYWFzX3Byb2plY3RfaWRtAAAAGDY2ZWM1ZjBiYzA1YWY4MDJmZGVkODNhOWptAAAABnN0YXR1c20AAAAIdmVyaWZpZWRtAAAAB3VzZXJfaWRtAAAAIDYwY2JmNDY0YTQxMDQxMmRiZDAyNzk0MWUzMTFkYjZlbQAAAAZzdGF0dXNtAAAAB3N1Y2Nlc3NuBgD3RlMLkgFiAAFRgA.CA6qgvKw9rHS8uENbrJOFGvy1KI7q2MSjla1EPaDOb4
origin: http://86e20414-239e-487a-adb8-9d0783455e89.com
content-type: multipart/mixed; boundary=plug_conn_test
{
"section": {
"type": "static",
"name": "wysiwyg"
},
"auto_insertion": false
}
Response
200
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1T4VjJnAOpyEABJcC
content-type: application/json; charset=utf-8
access-control-allow-origin: http://86e20414-239e-487a-adb8-9d0783455e89.com
{
"section": {
"type": "static",
"name": "wysiwyg"
},
"pages": [],
"name": "global_section",
"id": "66ec5f0cc05af802fd4b2ad7",
"auto_insertion": false
}
Edits an existing standalone section that you can use in multiple pages. Editing this global section instance will update it on all the pages where its being used.
Request
PUT api/v1/project/:project_id/global-instances/:name
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true | ||
project_id | Your project id in Sections | query_string | string | true | ||
section_name | Section name | query_string | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | section type resource | Section_Type |
400 | Error Resource | Error |
401 | Error Resource | Error |
Deletes a global section instance by its name
Delete a specific Global Sections by its name
DELETE /api/v1/project/66ec5f0bc05af802fded83a2/global-instances/global_section
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbHcDbmlsbQAAAA9zYWFzX3Byb2plY3RfaWRsAAAAAXQAAAACbQAAAARyb2xlbQAAAARVc2VybQAAAA9zYWFzX3Byb2plY3RfaWRtAAAAGDY2ZWM1ZjBiYzA1YWY4MDJmZGVkODNhMmptAAAABnN0YXR1c20AAAAIdmVyaWZpZWRtAAAAB3VzZXJfaWRtAAAAIDM0ZmVkZTVhNTM0ZDRlMTZiZWZjZTU3YzE4ZjAwZWM4bQAAAAZzdGF0dXNtAAAAB3N1Y2Nlc3NuBgB2RFMLkgFiAAFRgA.1C7WbvrlnhjYKHP5DM-jyZQ4a4v60o9zxfZMBZnI8dY
origin: http://3d393a55-8b4c-44e2-a62b-1de23aa17b78.com
Response
200
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1T2I6aPRgz_cABJYC
content-type: application/json; charset=utf-8
access-control-allow-origin: http://3d393a55-8b4c-44e2-a62b-1de23aa17b78.com
{
"message": "Deleted successfully."
}
Removes the Global Instance from the project. If the Global Instance is being used in a page it can't be removed
Request
DELETE api/v1/project/:project_id/global-instances/:name
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true | ||
project_id | Your project id in Sections | query_string | string | true | ||
section_name | Section name | query_string | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | section type resource | Section_Type |
400 | Error Resource | Error |
401 | Error Resource | Error |
423 | Error Resource Locked | Error |
Creates a static section type
Create Static ST
POST /api/v1/project/66ec5f03c05af802fd00bd4e/section-types/section_name_2c6da120-296a-4cd9-8fdd-adcce788c833
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbHcDbmlsbQAAAA9zYWFzX3Byb2plY3RfaWRsAAAAAXQAAAACbQAAAARyb2xlbQAAAARVc2VybQAAAA9zYWFzX3Byb2plY3RfaWRtAAAAGDY2ZWM1ZjAzYzA1YWY4MDJmZDAwYmQ0ZWptAAAABnN0YXR1c20AAAAIdmVyaWZpZWRtAAAAB3VzZXJfaWRtAAAAIDk0MGIwMzBjZjBiYzQ4NDY4ZmZkYTE4Y2U3Yjk4ZDMzbQAAAAZzdGF0dXNtAAAAB3N1Y2Nlc3NuBgCpJVMLkgFiAAFRgA.s8yhLfDah601E7Ky6r6SKNurVAvljgSf9vAVcbrL0vw
origin: http://40de7331-04be-4dea-a413-d1c16a9c8f2f.com
content-type: multipart/mixed; boundary=plug_conn_test
{
"fields": [
{
"type": "image",
"name": "profile"
},
{
"type": "image",
"name": "profile1"
}
]
}
Response
200
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1TXl01Xvl46MAA_zh
content-type: application/json; charset=utf-8
access-control-allow-origin: http://40de7331-04be-4dea-a413-d1c16a9c8f2f.com
{
"type": "static",
"name": "section_name_2c6da120-296a-4cd9-8fdd-adcce788c833",
"multiple": false,
"id": "66ec5f03c05af802fd00bd51",
"fields": [
{
"type": "image",
"name": "profile"
},
{
"type": "image",
"name": "profile1"
}
],
"dynamic_options": false,
"application_id": null,
"application": "sections",
"access": "private"
}
Declares a PRIVATE static section type for your project. Private sections are exclusive to only one project so these will only be visible by you.
Request
POST api/v1/project/{project_id}/section-types/{section_name}
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true | ||
project_id | Your project id in Sections | query_string | string | true | ||
section_name | Section name | query_string | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | section type resource | Section_Type |
400 | Error Resource | Error |
401 | Error Resource | Error |
402 | Error when you reach your package limitation | Error |
Renders the requested section's data
Render an existing ST
POST /api/v1/project/66ec5f05c05af802fd1ce26c/section/render
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbHcDbmlsbQAAAA9zYWFzX3Byb2plY3RfaWRsAAAAAXQAAAACbQAAAARyb2xlbQAAAARVc2VybQAAAA9zYWFzX3Byb2plY3RfaWRtAAAAGDY2ZWM1ZjA1YzA1YWY4MDJmZDFjZTI2Y2ptAAAABnN0YXR1c20AAAAIdmVyaWZpZWRtAAAAB3VzZXJfaWRtAAAAIDg1ZjhhYjhlZGEwMTQ0ZjJiMTg4NWY2YjM0MGFmNzRmbQAAAAZzdGF0dXNtAAAAB3N1Y2Nlc3NuBgBOLFMLkgFiAAFRgA.PDRlkQS9y-HX5B8l9nAVYLBCxEiRieZBu1mq5GXIZRY
origin: http://a11aeec3-2040-4131-ab1a-a5c1981a2c22.com
user-agent: user-agent-76d27699-f2ba-49af-820a-690e4bbec9c0
project-id-b456b66b-3f8c-4262-a0f7-996ffe61ec66: 1
content-type: multipart/mixed; boundary=plug_conn_test
{
"section": {
"weight": 1,
"name": "section_name_6bad2b4b-8ec4-4595-ac9e-ed9375b9d4a4"
}
}
Response
200
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1TfTRqZ0Pt3gABHmi
content-type: application/json; charset=utf-8
access-control-allow-origin: http://a11aeec3-2040-4131-ab1a-a5c1981a2c22.com
{
"weight": 1,
"type": "static",
"settings": {},
"render_data": "",
"region": {},
"query_string_keys": null,
"name": "section_name_6bad2b4b-8ec4-4595-ac9e-ed9375b9d4a4",
"linked_to": "",
"id": "66ec5f05c05af802fd1ce272",
"error": null
}
Renders the section's data for a preview. When rendering a public scoped section type and the request returns an unauthorized request error (status code 401). The section's status will be updated to invalid
. Then it will need the user's intervention to update his credentials for this section's application using this endpoint so the status gets adjusted again.
Request
POST api/v1/project/{project_id}/section/render
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true | ||
project_id | Your project id in Sections | query_string | string | true | ||
query_string | Query Strings | body | map | false | {id: 1} | |
section | A map containing the section name and its order (weight) in the page | body | map | true | {section: {name: '6038e54de3ba240007b07913:categories_articles', weight: '1'} } |
Responses
Status | Description | Schema |
---|---|---|
200 | section type resource | Section_Type |
400 | Error Resource | Error |
401 | Error Resource | Error |
Gets a configurable section type's options
Returning the options of a configurable section type to Sections
GET /api/v1/project/66ec5f09c05af802fdad8c00/section/66ec5f09c05af802fdad8c02%3Aselective_articles/options
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbHcDbmlsbQAAAA9zYWFzX3Byb2plY3RfaWRsAAAAAXQAAAACbQAAAARyb2xlbQAAAARVc2VybQAAAA9zYWFzX3Byb2plY3RfaWRtAAAAGDY2ZWM1ZjA5YzA1YWY4MDJmZGFkOGMwMGptAAAABnN0YXR1c20AAAAIdmVyaWZpZWRtAAAAB3VzZXJfaWRtAAAAIGJjOGEzMTg1OWM0MzQxODA4Y2VlYmY2OGEzYjY2NWQzbQAAAAZzdGF0dXNtAAAAB3N1Y2Nlc3NuBgBsO1MLkgFiAAFRgA.0sjfGWbR42Y3AZa9hmVhfoGjegCNeybVFRxy77FsysI
origin: http://9d84a37d-4611-4401-9d3a-3c25d8abe4e9.com
Response
200
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1TvN5o9l6Nf8ABBFh
content-type: application/json; charset=utf-8
access-control-allow-origin: http://9d84a37d-4611-4401-9d3a-3c25d8abe4e9.com
[
{
"option_values": [
{
"title": "Article 1",
"id": 1
},
{
"title": "Article 2",
"id": 2
}
],
"field": "article_ids"
}
]
Gets a configurable section type's options from the third party application. This is used so the user can choose the options he wants in order to render the configurable section type customized to his needs.
Request
GET api/v1/project/{project_id}/section/{section_name}/options
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true | ||
project_id | Your project id in Sections | query_string | string | true | ||
section_name | Section name | query_string | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | Options resource | Options |
400 | Error Resource | Error |
404 | Error Resource | Error |
Deletes a static section type
Delete Static ST
DELETE /api/v1/project/66ec5f06c05af802fd98d387/section-types/section_name_289116e8-556b-45c2-a57b-0f884b8dc8f8
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbHcDbmlsbQAAAA9zYWFzX3Byb2plY3RfaWRsAAAAAXQAAAACbQAAAARyb2xlbQAAAARVc2VybQAAAA9zYWFzX3Byb2plY3RfaWRtAAAAGDY2ZWM1ZjA2YzA1YWY4MDJmZDk4ZDM4N2ptAAAABnN0YXR1c20AAAAIdmVyaWZpZWRtAAAAB3VzZXJfaWRtAAAAIDUzM2Y1MDEyODkyODQ5YmNiNjg4NDU0ZGUyODdlNGQ2bQAAAAZzdGF0dXNtAAAAB3N1Y2Nlc3NuBgD9MVMLkgFiAAFRgA.l5doc_FVmrDNqCJoNno98CAjCv9tVTi-Iro-T1IEvSo
origin: http://3672390b-48a3-4a80-83e7-6f40bda69380.com
Response
200
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1TkRhpVaLlFwABIXC
content-type: application/json; charset=utf-8
access-control-allow-origin: http://3672390b-48a3-4a80-83e7-6f40bda69380.com
{
"message": "Deleted successfully."
}
Deletes a static section type
Request
DELETE api/v1/project/{project_id}/section-types/{section_name}
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true | ||
project_id | Your project id in Sections | query_string | string | true | ||
section_name | Section name | query_string | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | message resource | Message |
404 | Error Resource | Error |
Update the authorization fields for the considered app on your project
Upsert authorization fields for an application
PUT /api/v1/project/66ec5f04c05af802fde50117/authorization_fields/123456
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbHcDbmlsbQAAAA9zYWFzX3Byb2plY3RfaWRsAAAAAXQAAAACbQAAAARyb2xlbQAAAARVc2VybQAAAA9zYWFzX3Byb2plY3RfaWRtAAAAGDY2ZWM1ZjA0YzA1YWY4MDJmZGU1MDExN2ptAAAABnN0YXR1c20AAAAIdmVyaWZpZWRtAAAAB3VzZXJfaWRtAAAAIDYwZjlhNWNjOTFjMTRiY2JiMjU4YWNjOWM4NjUyYmUybQAAAAZzdGF0dXNtAAAAB3N1Y2Nlc3NuBgBBK1MLkgFiAAFRgA._YdbNVNSFxF_L7wrtkFAA3sDVsLsfn3OCHbxzbjxveY
origin: http://6c6dec8c-0373-4791-b92c-d8e4c68b0eb7.com
content-type: multipart/mixed; boundary=plug_conn_test
{
"authorization_fields": {
"project_id": 38,
"private_key": "private_key_hashed"
}
}
Response
404
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1Tc7FZIs0EaYABHKi
content-type: application/json; charset=utf-8
access-control-allow-origin: http://6c6dec8c-0373-4791-b92c-d8e4c68b0eb7.com
{
"options": {},
"message": "The app does not exist"
}
It verifies the authorization fields provided.
If the fields are valid then the project's configured fields will be updated to include this app's credentials.
These credentials will be used to render any public_scoped
section decalred by the third party app.
In case the credentials become invalid their status will be updated and it will need an update from the user.
This call will let you retrieve the application id for any public_scoped
section.
If you wish to unauthorize a particular app, you should update your project with the following payload:
{
"configured_fields": {
{replace_with_app_id}: {
"app_status": "disabled"
}
}
}
You can add several app_ids if you wish to unauthorize multiple apps at the same time.
Request
PUT api/v1/project/{project_id}/authorization_fields/{application_id}
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true | ||
project_id | Your project id in Sections | query_string | string | true | ||
application_id | The application's id in Sections | query_string | string | true | ||
authorization_fields | Authorization fields used to authenticate your request to third party services (only for public scoped section types) | body | map | true | {authorization_fields: {username: 'You', password: 'are awsome'} } |
Responses
Status | Description | Schema |
---|---|---|
200 | Project resource | Project |
410 | Error Resource | Error |
Creates a global section instance
Create a global Section instance
POST /api/v1/project/66ec5f04c05af802fde5010e/global-instances/global_section
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbHcDbmlsbQAAAA9zYWFzX3Byb2plY3RfaWRsAAAAAXQAAAACbQAAAARyb2xlbQAAAARVc2VybQAAAA9zYWFzX3Byb2plY3RfaWRtAAAAGDY2ZWM1ZjA0YzA1YWY4MDJmZGU1MDEwZWptAAAABnN0YXR1c20AAAAIdmVyaWZpZWRtAAAAB3VzZXJfaWRtAAAAIDYzNDk4ODM1OWEwNTQ3OWU4YjQ3MmZhMTU5MzllMmY1bQAAAAZzdGF0dXNtAAAAB3N1Y2Nlc3NuBgAyKFMLkgFiAAFRgA.P05aE2PlMVBEYsAhTY_cAy8ACX1cduX666zE6hkVarE
origin: http://8f75edc9-554f-4b9b-ba18-5c0a52d8bc16.com
content-type: multipart/mixed; boundary=plug_conn_test
{
"section": {
"weight": 2,
"type": "static",
"options": [
{
"data": "Test Wysiwyg content"
}
],
"name": "wysiwyg"
},
"regions": {
"standard": 1
}
}
Response
200
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1TaAeqQwy6fEAA9gj
content-type: application/json; charset=utf-8
access-control-allow-origin: http://8f75edc9-554f-4b9b-ba18-5c0a52d8bc16.com
{
"section": {
"weight": 2,
"type": "static",
"options": [
{
"data": "Test Wysiwyg content"
}
],
"name": "wysiwyg"
},
"pages": [],
"name": "global_section",
"id": "66ec5f04c05af802fde50110",
"auto_insertion": false
}
Creates a standalone section that you can use in multiple pages. Editing this global section instance will update it on all the pages where its being used.
Request
POST api/v1/project/:project_id/global-instances/:name
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true | ||
project_id | Your project id in Sections | query_string | string | true | ||
global_instance_name | Global Instance name | query_string | string | true | ||
section | A map containing the section name and its order (weight) in the page | body | map | true | {section: {name: '6038e54de3ba240007b07913:categories_articles', weight: '1'} } | |
auto_insertion | Indicate whether this section should be automatically added when a new page is being created. No effect on the API, just an indication to the page creator application | body | boolean | false |
Responses
Status | Description | Schema |
---|---|---|
200 | Global section instance | Section_Type |
400 | Error Resource | Error |
401 | Error Resource | Error |
List global section instances of a given project
List Global Sections of a given project
GET /api/v1/project/66ec5f0ec05af802fd10e449/global-instances
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbHcDbmlsbQAAAA9zYWFzX3Byb2plY3RfaWRsAAAAAXQAAAACbQAAAARyb2xlbQAAAARVc2VybQAAAA9zYWFzX3Byb2plY3RfaWRtAAAAGDY2ZWM1ZjBlYzA1YWY4MDJmZDEwZTQ0OWptAAAABnN0YXR1c20AAAAIdmVyaWZpZWRtAAAAB3VzZXJfaWRtAAAAIDljYmEyZTJlMDA1ZDRiMzlhOWI5NmYyNTk3NWM1YTk0bQAAAAZzdGF0dXNtAAAAB3N1Y2Nlc3NuBgACUFMLkgFiAAFRgA.6DK9vdrnsfvbMCACE3CE1e-uthH7PoE9Vkr_eDGCueA
origin: http://dbb01743-3bc2-40aa-a4d9-28e3c150ca2d.com
Response
200
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1UBvNqyQAQ7oABB_B
content-type: application/json; charset=utf-8
access-control-allow-origin: http://dbb01743-3bc2-40aa-a4d9-28e3c150ca2d.com
{
"total": 2,
"data": [
{
"section": {
"type": "static",
"name": "wysiwyg"
},
"pages": [],
"name": "global_section",
"id": "66ec5f0ec05af802fd10e44b",
"auto_insertion": false
},
{
"section": {
"type": "static",
"name": "wysiwyg"
},
"pages": [],
"name": "global_section_2",
"id": "66ec5f0ec05af802fd10e44e",
"auto_insertion": false
}
]
}
List all the Global instances of a given project
Request
GET api/v1/project/:project_id/global-instances
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true | ||
project_id | Your project id in Sections | query_string | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | section type resource | Section_Type |
400 | Error Resource | Error |
401 | Error Resource | Error |
Get a global section instance by its name
Get a specific Global Sections by its name
GET /api/v1/project/66ec5f0cc05af802fd4b2ade/global-instances/global_section
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbHcDbmlsbQAAAA9zYWFzX3Byb2plY3RfaWRsAAAAAXQAAAACbQAAAARyb2xlbQAAAARVc2VybQAAAA9zYWFzX3Byb2plY3RfaWRtAAAAGDY2ZWM1ZjBjYzA1YWY4MDJmZDRiMmFkZWptAAAABnN0YXR1c20AAAAIdmVyaWZpZWRtAAAAB3VzZXJfaWRtAAAAIDJkMGU4ZTJmMWQ5YzRlNDE5ZDJiYjFjODRmMDQ0YjZlbQAAAAZzdGF0dXNtAAAAB3N1Y2Nlc3NuBgCzSVMLkgFiAAFRgA.Z9EyzWgLiP1Vvm60XA72CYcTwcJlKeoWInmtOhFiqdg
origin: http://69848be9-a474-4192-951b-49d47e4ac463.com
Response
200
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1T61QhphevEAABBrh
content-type: application/json; charset=utf-8
access-control-allow-origin: http://69848be9-a474-4192-951b-49d47e4ac463.com
{
"section": {
"type": "static",
"name": "wysiwyg"
},
"pages": [],
"name": "global_section",
"id": "66ec5f0cc05af802fd4b2ae0",
"auto_insertion": false
}
Returns the global instance with the provided name that belongs to the project
Request
GET api/v1/project/:project_id/global-instances/:name
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true | ||
project_id | Your project id in Sections | query_string | string | true | ||
section_name | Section name | query_string | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | section type resource | Section_Type |
400 | Error Resource | Error |
401 | Error Resource | Error |
4. Packages and API limits
To ensure a faire usage from all users and provide a stable quality of service we have two layers of limitations, the first one is based on the resources your project can use, the bigger the package the more resources you are allowed to use (i.e number of pages, number of static sections types etc...). Once you reach a limit, any tentative to cross this limit will return an error with code 402. The only way for you to overcome this is to free up some resources or to upgrade your package.
Then we also are capping the number of requests you can issue on a project, here again the package you are on will define your cap. The bigger the package the more API requests you will be authorized to submit. If you reach your limit, any further requests will error with code 429. These limits gets reset per time cycle, you can either wait for the cycle to reset your limit or you can upgrade your package to overcome this limit.
Read below to retrieve your project package with the details of the limits applying to it
Gets the current package of the project
GET a package by name and active package/
GET /api/v1/project/66ec5f7bc05af802fd1d44fb/active_package
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbHcDbmlsbQAAAA9zYWFzX3Byb2plY3RfaWRsAAAAAXQAAAACbQAAAARyb2xlbQAAAAR1c2VybQAAAA9zYWFzX3Byb2plY3RfaWRtAAAAGDY2ZWM1ZjdiYzA1YWY4MDJmZDFkNDRmYmptAAAABnN0YXR1c20AAAAIdmVyaWZpZWRtAAAAB3VzZXJfaWRtAAAAIDZkNGNjYmVkNWE2ZDRmYTI5NzE0MGU5OThkY2IzM2U5bQAAAAZzdGF0dXNtAAAAB3N1Y2Nlc3NuBgC0_FQLkgFiAAFRgA.wwQmTNwrHvpl_BZ_A24NWkk3XYnyBzt--2tuDOG_ygc
origin: http://5254275d-9873-42fa-aed5-4f0d4e17fa9a.com
Response
200
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1aZpk2xxr2PoABExB
content-type: application/json; charset=utf-8
access-control-allow-origin: http://5254275d-9873-42fa-aed5-4f0d4e17fa9a.com
{
"type": "public",
"rank": 0,
"quota": -1,
"price": 0,
"name": "free",
"locked": false,
"limits": [
{
"value": 0,
"name": "query_string_support"
},
{
"value": 2,
"name": "number_of_pages"
},
{
"value": 1,
"name": "variation_per_page"
},
{
"value": 5,
"name": "static_sections"
},
{
"value": 5,
"name": "sections_total"
},
{
"value": 10,
"name": "hosted_files"
},
{
"value": 500000,
"name": "size_per_file"
},
{
"value": 10,
"name": "api_limit_sec"
},
{
"value": 100,
"name": "api_limit_minute"
},
{
"value": -1,
"name": "api_limit_hour"
},
{
"value": 500,
"name": "api_limit_day"
},
{
"value": 0,
"name": "dynamic_section_types_support"
},
{
"value": 2,
"name": "users"
},
{
"value": 2,
"name": "domains"
}
],
"label": "Free",
"id": "66ec5f01c05af802fdac0c90"
}
This call will return the package name and associated limits for your project
Request
GET /api/v1/project/{project_id}/active_package
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
project_id | Your project id in Sections | query_string | string | true | ||
token | Sections Token | header | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | Package Resource | Package |
Get available packages
GET all public packages
GET /api/v1/project/66ec5f79c05af802fd95706b/packages
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbHcDbmlsbQAAAA9zYWFzX3Byb2plY3RfaWRsAAAAAXQAAAACbQAAAARyb2xlbQAAAAR1c2VybQAAAA9zYWFzX3Byb2plY3RfaWRtAAAAGDY2ZWM1Zjc5YzA1YWY4MDJmZDk1NzA2YmptAAAABnN0YXR1c20AAAAIdmVyaWZpZWRtAAAAB3VzZXJfaWRtAAAAIDJiODUwYmI3NTFlMDRjNzFhM2I5Y2NiMzc3MjJmNWM1bQAAAAZzdGF0dXNtAAAAB3N1Y2Nlc3NuBgDp8lQLkgFiAAFRgA.TGGB33hoZ3QtkCuL_IR3HKY812EarcBBSEJwHyU69Qk
origin: http://9d4c4ed3-1f37-459e-8811-7c3153f279db.com
Response
200
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1aPeI9YrA-lgABEqh
content-type: application/json; charset=utf-8
access-control-allow-origin: http://9d4c4ed3-1f37-459e-8811-7c3153f279db.com
{
"total": 6,
"data": [
{
"type": "public",
"rank": 2,
"quota": 2,
"price": 14900,
"name": "corporate",
"locked": false,
"limits": [
{
"value": -1,
"unit_price": 150,
"name": "number_of_pages",
"included": 10
},
{
"value": -1,
"name": "query_string_support"
},
{
"value": 5,
"name": "variation_per_page"
},
{
"value": 20,
"name": "static_sections"
},
{
"value": 15,
"name": "sections_total"
},
{
"value": 300,
"name": "hosted_files"
},
{
"value": 2000000,
"name": "size_per_file"
},
{
"value": -1,
"name": "api_limit_sec"
},
{
"value": -1,
"name": "api_limit_minute"
},
{
"value": 3000,
"name": "api_limit_hour"
},
{
"value": 20000,
"name": "api_limit_day"
},
{
"value": -1,
"name": "dynamic_section_types_support"
},
{
"value": 5,
"name": "users"
},
{
"value": -1,
"unit_price": 1000,
"name": "domains",
"included": 3
}
],
"label": "Corporate",
"id": "66ec5f01c05af802fdac0c92"
},
{
"type": "public",
"rank": 0,
"quota": -1,
"price": 0,
"name": "free",
"locked": false,
"limits": [
{
"value": 0,
"name": "query_string_support"
},
{
"value": 2,
"name": "number_of_pages"
},
{
"value": 1,
"name": "variation_per_page"
},
{
"value": 5,
"name": "static_sections"
},
{
"value": 5,
"name": "sections_total"
},
{
"value": 10,
"name": "hosted_files"
},
{
"value": 500000,
"name": "size_per_file"
},
{
"value": 10,
"name": "api_limit_sec"
},
{
"value": 100,
"name": "api_limit_minute"
},
{
"value": -1,
"name": "api_limit_hour"
},
{
"value": 500,
"name": "api_limit_day"
},
{
"value": 0,
"name": "dynamic_section_types_support"
},
{
"value": 2,
"name": "users"
},
{
"value": 2,
"name": "domains"
}
],
"label": "Free",
"id": "66ec5f01c05af802fdac0c90"
},
{
"type": "public",
"rank": 3,
"quota": -1,
"price": 1999,
"name": "premium",
"locked": false,
"limits": [
{
"value": -1,
"name": "query_string_support"
},
{
"value": 20,
"name": "number_of_pages"
},
{
"value": 1,
"name": "variation_per_page"
},
{
"value": 10,
"name": "static_sections"
},
{
"value": 5,
"name": "sections_total"
},
{
"value": 7,
"name": "hosted_files"
},
{
"value": 500000,
"name": "size_per_file"
},
{
"value": 10,
"name": "api_limit_sec"
},
{
"value": -1,
"name": "api_limit_hour"
},
{
"value": 100,
"name": "api_limit_minute"
},
{
"value": 500,
"name": "api_limit_day"
},
{
"value": -1,
"name": "dynamic_section_types_support"
},
{
"value": 2,
"name": "users"
},
{
"value": 5,
"name": "domains"
}
],
"label": "premium",
"id": "66ec5f79c05af802fd95706a"
},
{
"type": "public",
"rank": 5,
"quota": 0,
"price": 10,
"name": "qs_enabled",
"locked": false,
"limits": [
{
"value": -1,
"name": "query_string_support"
},
{
"value": 3,
"name": "number_of_pages"
},
{
"value": 1,
"name": "variation_per_page"
},
{
"value": 10,
"name": "static_sections"
},
{
"value": 5,
"name": "sections_total"
},
{
"value": 10,
"name": "hosted_files"
},
{
"value": 500000,
"name": "size_per_file"
},
{
"value": 10,
"name": "api_limit_sec"
},
{
"value": 100,
"name": "api_limit_minute"
},
{
"value": 100,
"name": "api_limit_hour"
},
{
"value": 500,
"name": "api_limit_day"
},
{
"value": -1,
"name": "dynamic_section_types_support"
},
{
"value": 2,
"name": "users"
},
{
"value": 5,
"name": "domains"
}
],
"label": "QS_enabled",
"id": "66ec5f1cc05af802fd9446fa"
},
{
"type": "public",
"rank": 1,
"quota": -1,
"price": 2900,
"name": "solo",
"locked": false,
"limits": [
{
"value": 0,
"name": "query_string_support"
},
{
"value": 5,
"name": "number_of_pages"
},
{
"value": 2,
"name": "variation_per_page"
},
{
"value": 10,
"name": "static_sections"
},
{
"value": 10,
"name": "sections_total"
},
{
"value": 100,
"name": "hosted_files"
},
{
"value": 1000000,
"name": "size_per_file"
},
{
"value": -1,
"name": "api_limit_sec"
},
{
"value": -1,
"name": "api_limit_minute"
},
{
"value": 500,
"name": "api_limit_hour"
},
{
"value": 1000,
"name": "api_limit_day"
},
{
"value": 0,
"name": "dynamic_section_types_support"
},
{
"value": 2,
"name": "users"
},
{
"value": 1,
"name": "domains"
}
],
"label": "Standard",
"id": "66ec5f01c05af802fdac0c91"
},
{
"type": "public",
"rank": 3,
"quota": -1,
"price": 1999,
"name": "something",
"locked": false,
"limits": [
{
"value": -1,
"name": "query_string_support"
},
{
"value": 2,
"name": "number_of_pages"
},
{
"value": 1,
"name": "variation_per_page"
},
{
"value": 10,
"name": "static_sections"
},
{
"value": 5,
"name": "sections_total"
},
{
"value": 10,
"name": "hosted_files"
},
{
"value": 500000,
"name": "size_per_file"
},
{
"value": 10,
"name": "api_limit_sec"
},
{
"value": 100,
"name": "api_limit_minute"
},
{
"value": 100,
"name": "api_limit_hour"
},
{
"value": 500,
"name": "api_limit_day"
},
{
"value": -1,
"name": "dynamic_section_types_support"
},
{
"value": 2,
"name": "users"
},
{
"value": 5,
"name": "domains"
}
],
"label": "Free",
"id": "66ec5f75c05af802fd5e8fb7"
}
]
}
This call will list all the public and private packages with their attached limits that your project can subscribe to. If you have specific needs requiring the customization of certains limits, contact us to build with you a custom private package. Note that locked package won't be returned here unless you it is the package you are already subscribed to. If you update your project from a locked package to another one, you won't be able to come back to the locked package.
Request
GET /api/v1/project/{project_id}/packages
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
project_id | Your project id in Sections | query_string | string | true | ||
token | Sections Token | header | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | List of package resource | Package |
5. User Management
This part will guide on how to manage your account on Sections.
Register through the API
Register user and project
POST /api/v1/register
origin: http://clientapp.com:3001
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbHcDbmlsbQAAAA9zYWFzX3Byb2plY3RfaWRsAAAAAXQAAAACbQAAAARyb2xlbQAAAAR1c2VybQAAAA9zYWFzX3Byb2plY3RfaWRtAAAAGDY2ZWM1ZjMzYzA1YWY4MDJmZGI2OTRmZmptAAAABnN0YXR1c20AAAAIdmVyaWZpZWRtAAAAB3VzZXJfaWRtAAAAIDFjZThhYmFlYTJkYzQ4MjViNmVlODE0MjNlNTNmNTFibQAAAAZzdGF0dXNtAAAAB3N1Y2Nlc3NuBgC841MLkgFiAAFRgA.MCVPArU2PhH8msidp-hYE_X4L-aFR-HumCCMwxB_r9k
content-type: multipart/mixed; boundary=plug_conn_test
{
"user": {
"terms_conditions": true,
"password": "password",
"full_name": "Fullname",
"email": "success@gmail.com"
},
"project": {
"title": "Your Project Title",
"project_url": [
"your.url.com"
],
"login_redirect_url": "https://your.url.com"
}
}
Response
200
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1WNMOZaZY52sABJ9i
content-type: application/json; charset=utf-8
access-control-allow-origin: http://clientapp.com:3001
{
"data": {
"user": {
"user_id": "123userid123",
"saas_project_id": [
{
"title": "Your Project Title",
"saas_project_id": "66ec5f34c05af802fd0e8128",
"role": "admin"
}
],
"last_login": 1726766900,
"full_name": "Someone",
"email": "someone40284f274ad84005badbeb8b400e742f@eweev.com"
},
"token": {
"token": "this is a token"
},
"project": {
"updated_at": 1726766900,
"type": "private",
"title": "Your Project Title",
"reason": null,
"project_url": [
"your.url.com"
],
"private_key": "$2b$12$gYvkKDAoOcnn8SaCIGoJte2KnZ3Dek6iz0R8FchV0.KkuEpnlieeu",
"package": "free",
"login_redirect_url": "https://your.url.com",
"limitation_status": "active",
"last_req_date": null,
"inserted_at": 1726766900,
"id": "66ec5f34c05af802fd0e8128",
"files_counter": 0,
"configured_fields": {},
"billing_status": "upgrade_lock",
"active": true,
"__meta__": {
"state": "built",
"source": "project",
"schema": "Elixir.Sections.Section.Project",
"prefix": null,
"context": null
}
}
}
}
API Route to be able to register a new user, and create this user's new project.
We now support the ability to include multiple project URLs used to pass CORS, by passing
a list of valid URLS as the value of project_key
Request
POST api/v1/register
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
project | Project Model. | body | map | true | {'active' => true,'configured_fields' => {'blogs' => {'private_key' => 'xxxxxx','project_id' => 1}},'files_counter' => 0,'id' => '601bf1221907a50007ba3f81','login_redirect_url' => 'https://your.project.url.com/redirect_login/admin','package' => 'free','private_key' => 'xxxxxx','project_url' => ['https://your.project.url.com'],'reason' => nil,'type' => 'private'} | |
user | User Model. | body | map | true | {email: 'your_new_email@gmail.com', password: 'new_pass', current_pass: 'current_pass'} } |
Responses
Status | Description | Schema |
---|---|---|
200 | User resource | User |
410 | Error Resource | Error |
Get the pending invitations to a project.
Invite user to project success - user exists
GET /api/v1/project/66ec5f2ac05af802fd6d9fc0/pending_invitations
origin: http://51613676-c813-4176-8fa9-a3e080e41c10.com
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbHcDbmlsbQAAAA9zYWFzX3Byb2plY3RfaWRsAAAAAXQAAAACbQAAAARyb2xlbQAAAAVhZG1pbm0AAAAPc2Fhc19wcm9qZWN0X2lkbQAAABg2NmVjNWYyYWMwNWFmODAyZmQ2ZDlmYzBqbQAAAAZzdGF0dXNtAAAACHZlcmlmaWVkbQAAAAd1c2VyX2lkbQAAACAwMzhiNDcyNTdiMTI0MDFlOGQ3Y2QxNWE4ZjIxNDgxMG0AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYAiL9TC5IBYgABUYA.zcdnUcnm-yqF5eMUEN_t8JbTIDurHpqVCvdBtHoH4Uc
Response
200
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1VrPHlIGZ9n8ABDBB
content-type: application/json; charset=utf-8
access-control-allow-origin: http://51613676-c813-4176-8fa9-a3e080e41c10.com
{
"users": [
{
"role": "webmaster",
"invited_at": 1726766890,
"email": "email@eweev.com"
}
],
"total": 1
}
Used to fetch pending invitation to (existing or non existing) user emails to join your project with a specific role.
Request
GET api/v1/project/:project_id/pending_invitations
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
project_id | Your project id in Sections | query_string | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | Pending Invitation Resource | Pending_Invitation |
401 | Error Resource | Error |
Get your user information.
get user based on token
GET /api/v1/project/66ec5f23c05af802fdecca3f/user
origin: http://28e89ad7-1958-46d2-ada9-b00503a5dbb9.com
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbHcDbmlsbQAAAA9zYWFzX3Byb2plY3RfaWRsAAAAAXQAAAACbQAAAARyb2xlbQAAAAl3ZWJtYXN0ZXJtAAAAD3NhYXNfcHJvamVjdF9pZG0AAAAYNjZlYzVmMjNjMDVhZjgwMmZkZWNjYTNmam0AAAAGc3RhdHVzbQAAAAh2ZXJpZmllZG0AAAAHdXNlcl9pZG0AAAAgMWEyY2I4MDJlM2VjNGRlMzg5YTg5MjRjMWQ1ODNiM2ZtAAAABnN0YXR1c20AAAAHc3VjY2Vzc24GAOeiUwuSAWIAAVGA.Lo_P8erAEfRp2nJFLM7hAhSXg9JxKjPEtayP7g9bC6E
{
"aspect": "body_params"
}
Response
200
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1VPB1Zl7oW2wAA95j
content-type: application/json; charset=utf-8
access-control-allow-origin: http://28e89ad7-1958-46d2-ada9-b00503a5dbb9.com
{
"token": null,
"status": null,
"roles": null,
"projects": [
{
"saas_project_id": "66ec5f23c05af802fdecca3f",
"role": "admin"
}
],
"inserted_at": null,
"id": "1",
"full_name": "Full Name",
"email": "email@eweev.com"
}
Used to get your own user information based on the token.
Request
GET api/v1/project/:project_id/user
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
project_id | Your project id in Sections | query_string | string | true | ||
origin | Request Origin | header | string | true | https://your.project.url.com | |
token | Sections Token | header | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | User resource | User |
401 | Error Resource | Error |
Verify your Sections account
Verify user
POST /api/v1/verify_user
origin: http://clientapp.com:3001
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbHcDbmlsbQAAAA9zYWFzX3Byb2plY3RfaWRsAAAAAXQAAAACbQAAAARyb2xlbQAAAAR1c2VybQAAAA9zYWFzX3Byb2plY3RfaWRtAAAAGDY2ZWM1ZjMwYzA1YWY4MDJmZDQ3OTgwMmptAAAABnN0YXR1c20AAAAIdmVyaWZpZWRtAAAAB3VzZXJfaWRtAAAAIDBkMzlhNmQ3MmNlODRiZjI5ZTU0Nzk1N2QxYjQ2ZTczbQAAAAZzdGF0dXNtAAAAB3N1Y2Nlc3NuBgAO1VMLkgFiAAFRgA.2SWXkA-bqyZVkkYVQBRCA4oadTrvPdArgNdnxsCT3ak
content-type: multipart/mixed; boundary=plug_conn_test
{
"token": "this is the token"
}
Response
200
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1V_Joax7DR4wABJ7C
content-type: application/json; charset=utf-8
access-control-allow-origin: http://clientapp.com:3001
{
"message": "Your email has been successfully verified."
}
Used to verify your Sections account.
You are expected to use the token
received in the verification email as the token
authorization header.
Request
POST api/v1/verify_user
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true | ||
origin | Request Origin | header | string | true | https://your.project.url.com |
Responses
Status | Description | Schema |
---|---|---|
200 | Message resource | Message |
410 | Error Resource | Error |
Login through the API
login
POST /login
origin: http://clientapp.com:3001
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbHcDbmlsbQAAAA9zYWFzX3Byb2plY3RfaWRsAAAAAXQAAAACbQAAAARyb2xlbQAAAAR1c2VybQAAAA9zYWFzX3Byb2plY3RfaWRtAAAAGDY2ZWM1ZjMwYzA1YWY4MDJmZDQ3OTgwM2ptAAAABnN0YXR1c20AAAAIdmVyaWZpZWRtAAAAB3VzZXJfaWRtAAAAIGMyY2IwNTAyNGRhYTRiMjg5ODY5NmU4OTZhOTBmOTc4bQAAAAZzdGF0dXNtAAAAB3N1Y2Nlc3NuBgAV11MLkgFiAAFRgA.Hr7B0t4yqsiA58TcqOBntqoQbkQrdLOkTJLPmKI4TsY
content-type: multipart/mixed; boundary=plug_conn_test
{
"password": "password",
"email": "success@gmail.com"
}
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1WBDRe_8p2QUABJ8C
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
x-content-type-options: nosniff
x-download-options: noopen
x-permitted-cross-domain-policies: none
cross-origin-window-policy: deny
{
"token": {
"token": "this is a token"
},
"status": null,
"roles": null,
"projects": [
{
"title": null,
"saas_project_id": "66ec5f30c05af802fd479803",
"role": "webmaster"
}
],
"inserted_at": null,
"id": "123userid123",
"full_name": "Someone",
"email": "someonebab3d2bfd1474e23acb084160a4dba77@eweev.com"
}
API Route to be able to login and retrieve a user token, used for authorization.
The project_id
query parameter, alongside the project URL as the origin
header, are used to be able to pass CORS.
You can also use the encoded version of the project private key
to bypass CORS, and act as the project administrator.
Request
POST api/v1/login?project_id={PROJECT_ID}
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
project_id | Your project id in Sections | query_string | string | true | ||
origin | Request Origin | header | string | true | https://your.project.url.com |
Responses
Status | Description | Schema |
---|---|---|
200 | User resource | User |
410 | Error Resource | Error |
Updates User
Update User
PUT /api/v1/project/66ec5f6cc05af802fdfc2394/user
origin: http://f921747b-bec2-4adf-af51-c453e9e612fa.com
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbHcDbmlsbQAAAA9zYWFzX3Byb2plY3RfaWRsAAAAAXQAAAACbQAAAARyb2xlbQAAAAR1c2VybQAAAA9zYWFzX3Byb2plY3RfaWRtAAAAGDY2ZWM1ZjZjYzA1YWY4MDJmZGZjMjM5NGptAAAABnN0YXR1c20AAAAIdmVyaWZpZWRtAAAAB3VzZXJfaWRtAAAAIDhmYzY3NmNjY2NmNTQwMTg4OGNlNTUxMjZlM2NlMTY1bQAAAAZzdGF0dXNtAAAAB3N1Y2Nlc3NuBgD-v1QLkgFiAAFRgA.m-4kBxcUAt2tzShAjnijL7qmixNON-gLmFUszunBRvE
content-type: multipart/mixed; boundary=plug_conn_test
{
"password": "new_password",
"full_name": "Your updated name",
"email": "new_email@eweev.com",
"current_password": "your_current_pass",
"confirm_password": "new_password"
}
Response
200
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1Ze6Ve8YL_18ABEJB
content-type: application/json; charset=utf-8
access-control-allow-origin: http://f921747b-bec2-4adf-af51-c453e9e612fa.com
{
"token": null,
"status": "pending",
"roles": null,
"projects": null,
"inserted_at": null,
"id": "8fc676ccccf5401888ce55126e3ce165",
"full_name": "Your updated name",
"email": "new_email@eweev.com"
}
This call updates the user. Be careful when updating your email or password you need to supply you current password to authenticate your call under the field current_password
.
Request
PUT api/v1/project/{project_id}/user
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
project_id | Your project id in Sections | query_string | string | true | ||
token | Sections Token | header | string | true | ||
user | User Model. | body | map | true | {email: 'your_new_email@gmail.com', password: 'new_pass', current_pass: 'current_pass'} } |
Responses
Status | Description | Schema |
---|---|---|
200 | section type resource | User |
400 | section type resource | Error |
410 | Error Resource | Error |
Add a User
Add a user to a project
PUT /api/v1/project/66ec5f69c05af802fd1b2d08/add_user
origin: http://7aeb4998-09da-4c68-b7de-8026e233ce02.com
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbHcDbmlsbQAAAA9zYWFzX3Byb2plY3RfaWRsAAAAAXQAAAACbQAAAARyb2xlbQAAAAR1c2VybQAAAA9zYWFzX3Byb2plY3RfaWRtAAAAGDY2ZWM1ZjY5YzA1YWY4MDJmZDFiMmQwOGptAAAABnN0YXR1c20AAAAIdmVyaWZpZWRtAAAAB3VzZXJfaWRtAAAAIDVjOWJjZDRlNmFkMzQ1NjE5MzY5ZTA5NGQwMDcyNzFmbQAAAAZzdGF0dXNtAAAAB3N1Y2Nlc3NuBgD4tFQLkgFiAAFRgA.cksVIAttzvMCUQ4pf_d8knIH4utLlVuCfJESXh8sF_U
content-type: multipart/mixed; boundary=plug_conn_test
{
"saas_project_id": "66ec5f69c05af802fd1b2d08",
"role": "User",
"email": "USER_EMAIL@gmail.com"
}
Response
200
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1ZUZqR3CulKcABECB
content-type: application/json; charset=utf-8
access-control-allow-origin: http://7aeb4998-09da-4c68-b7de-8026e233ce02.com
{
"token": null,
"status": null,
"roles": null,
"projects": [
{
"saas_project_id": "66ec5f69c05af802fd1b2d08",
"role": "User",
"accepted_on": 1726766953
}
],
"inserted_at": null,
"id": "49ee87ac-85b3-419d-bb02-f3b1c331f406",
"full_name": null,
"email": null
}
This call adds the user, of the given email, to a project you are an admin on.
Request
PUT api/v1/project/{project_id}/add_user
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
project_id | Your project id in Sections | query_string | string | true | ||
token | Sections Token | header | string | true | ||
user | User Model. | body | map | true | [123,10,32,32,32,32,32,32,34,115,97,97,115,95,112,114,111,106,101,99,116,95,105,100,34,58,32,34,54,48,100,97,101,49,97,49,48,97,57,57,56,54,50,99,50,97,55,48,97,98,49,49,34,44,10,32,32,32,32,32,32,34,114,111,108,101,34,58,32,34,85,115,101,114,34,44,10,32,32,32,32,32,32,34,101,109,97,105,108,34,58,32,34,97,46,115,97,114,107,105,115,43,98,108,111,103,49,48,48,64,101,119,101,101,118,46,99,111,109,34,10,32,32,32,32,125] |
Responses
Status | Description | Schema |
---|---|---|
200 | section type resource | User |
400 | section type resource | Error |
401 | Error Resource | Error |
404 | section type resource | Error |
Invite a user to join your project
Invite user to project success - user exists
POST /api/v1/project/66ec5f2ac05af802fd6d9fc0/invite_user
origin: http://51613676-c813-4176-8fa9-a3e080e41c10.com
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbHcDbmlsbQAAAA9zYWFzX3Byb2plY3RfaWRsAAAAAXQAAAACbQAAAARyb2xlbQAAAAVhZG1pbm0AAAAPc2Fhc19wcm9qZWN0X2lkbQAAABg2NmVjNWYyYWMwNWFmODAyZmQ2ZDlmYzBqbQAAAAZzdGF0dXNtAAAACHZlcmlmaWVkbQAAAAd1c2VyX2lkbQAAACAwMzhiNDcyNTdiMTI0MDFlOGQ3Y2QxNWE4ZjIxNDgxMG0AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYAiL9TC5IBYgABUYA.zcdnUcnm-yqF5eMUEN_t8JbTIDurHpqVCvdBtHoH4Uc
content-type: multipart/mixed; boundary=plug_conn_test
{
"invitation_user_email": [
"email@eweev.com"
],
"invitation_role": "webmaster"
}
Response
200
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1VqVOP5-Z9n8ABJ5i
content-type: application/json; charset=utf-8
access-control-allow-origin: http://51613676-c813-4176-8fa9-a3e080e41c10.com
{
"invited": [
"email@eweev.com"
],
"invalid_format": [],
"failed_to_send": [],
"demotion": []
}
Used to send an invitation to (existing or non existing) user emails to join your project with a specific role.
Request
POST api/v1/project/:project_id/invite_user
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
project_id | Your project id in Sections | query_string | string | true | ||
invitation_role | The role to invite the users as | body | string | true | one of:webmaster,admin | |
invitation_emails | List of emails to invite to the project | body | array | true | ['email1@gmail.com','email2@gmail.com'] |
Responses
Status | Description | Schema |
---|---|---|
200 | Invitation Resource | Invitation |
401 | Error Resource | Error |
Accept an invitation to join a project.
Accept invitation to project success - user exists
POST /api/v1/invitation/accept_invitation
origin: http://dec42bc5-6202-4c0c-a7df-497c17b0e371.com
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbHcDbmlsbQAAAA9zYWFzX3Byb2plY3RfaWRsAAAAAXQAAAACbQAAAARyb2xlbQAAAAR1c2VybQAAAA9zYWFzX3Byb2plY3RfaWRtAAAAGDY2ZWM1ZjJkYzA1YWY4MDJmZGMwNzFlY2ptAAAABnN0YXR1c20AAAAIdmVyaWZpZWRtAAAAB3VzZXJfaWRtAAAAIDhhNTNiODFhMTdmZTQxZDlhYTE3OGRkYzZhNjJhZGM3bQAAAAZzdGF0dXNtAAAAB3N1Y2Nlc3NuBgCNy1MLkgFiAAFRgA.tYOnwfZk24DQbBPOgLhij37TTGYP1Nkkclq2OJjsSsg
content-type: multipart/mixed; boundary=plug_conn_test
{
"invitation_token": "SFMyNTY.g2gDdAAAAANtAAAACnByb2plY3RfaWRtAAAAGDY2ZWM1ZjJkYzA1YWY4MDJmZGMwNzFlY20AAAAEcm9sZW0AAAAJd2VibWFzdGVybQAAAAp1c2VyX2VtYWlsbQAAABBlbWFpbDFAZW1haWwuY29tbgYAVsxTC5IBYgABUYA.4OCg8V9WE0rrEF3c-fpGuD2gAtdfdoFpVn7tJka_6no"
}
Response
200
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1V2ivJ-DTVjAABDGB
content-type: application/json; charset=utf-8
{
"token": null,
"status": null,
"roles": null,
"projects": [
{
"title": null,
"saas_project_id": "66ec5f2dc05af802fdc071ec",
"role": "webmaster"
}
],
"inserted_at": null,
"id": "4e2368a2982649bb911d7758b9d5a87c",
"full_name": "Full name",
"email": "email1@email.com"
}
Used to accept an invitation to join a project with a specific role.
You are expected to add the token
received in the email as the token
authorization header.
Request
POST /api/v1/invitation
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | User Resource | User |
401 | Error Resource | Error |
Cancel an invitation
Accept invitation to project failure - invitation cancelled
DELETE /api/v1/project/66ec5f31c05af802fd9c90ba/cancel_invitation
origin: http://af71e216-6623-47db-b6ff-c70158c59be3.com
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbHcDbmlsbQAAAA9zYWFzX3Byb2plY3RfaWRsAAAAAXQAAAACbQAAAARyb2xlbQAAAAVhZG1pbm0AAAAPc2Fhc19wcm9qZWN0X2lkbQAAABg2NmVjNWYzMWMwNWFmODAyZmQ5YzkwYmFqbQAAAAZzdGF0dXNtAAAACHZlcmlmaWVkbQAAAAd1c2VyX2lkbQAAACAyNGI2YTM5OGNiOTQ0Njg2OGFjMGMwNjQ4ZWU1ODgzNm0AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYAcNpTC5IBYgABUYA.T_LQ96oFrwzJ-HKa8Vw2q1bgSz2I1y6R6D2SF4_5LjI
content-type: multipart/mixed; boundary=plug_conn_test
{
"invitation_user_email": "email1@email.com"
}
Response
200
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1WE73NypjnbAABDLB
content-type: application/json; charset=utf-8
access-control-allow-origin: http://af71e216-6623-47db-b6ff-c70158c59be3.com
{
"message": "Invitation cancelled successfuly"
}
Used to cancel invitations sent to specific emails.
Request
DELETE api/v1/project/:project_id/cancel_invitation
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
project_id | Your project id in Sections | query_string | string | true | ||
invitation_email | Email to cancel invitation to the project | body | string | true | 'email1@gmail.com','email2@gmail.com' |
Responses
Status | Description | Schema |
---|---|---|
200 | Message Resource | Message |
401 | Error Resource | Error |
6. Medias
This part is dedicated to give you a clear idea on how to manage your medias. A media is an entity that holds a file that can be used across multiple sections. We can create a media using a base64 file. You are limited to the number of medias and the size of each media file based on your subscription.
Creates a media
Create a page with valid section using medias ids then keep sync
POST /api/v1/project/66ec5f06c05af802fd98d388/media
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbHcDbmlsbQAAAA9zYWFzX3Byb2plY3RfaWRsAAAAAXQAAAACbQAAAARyb2xlbQAAAARVc2VybQAAAA9zYWFzX3Byb2plY3RfaWRtAAAAGDY2ZWM1ZjA2YzA1YWY4MDJmZDk4ZDM4OGptAAAABnN0YXR1c20AAAAIdmVyaWZpZWRtAAAAB3VzZXJfaWRtAAAAIDdiMWQzMDlhMTUzZTQwZWY4MDg5MDk1MTdmZDNlYzkwbQAAAAZzdGF0dXNtAAAAB3N1Y2Nlc3NuBgD_MVMLkgFiAAFRgA.1Jw8rIbvFzB_1f_JEZp1DJMC600jT1txTNzfIohsU3s
origin: http://bda0aa0e-ef46-4847-848a-3d7a3a56d731.com
content-type: multipart/mixed; boundary=plug_conn_test
{
"type": "image",
"private_status": "public",
"locked_status": "unlocked",
"files": {
"1": {
"file": {
"content_type": "image/svg",
"path": "test/support/toggle.png",
"filename": "blue.svg"
}
}
}
}
Response
200
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1TjWlYq-kMAwABIVi
content-type: application/json; charset=utf-8
access-control-allow-origin: http://bda0aa0e-ef46-4847-848a-3d7a3a56d731.com
{
"type": "image",
"title": null,
"tags": null,
"seo_tag": null,
"private_status": "public",
"number_of_contents": 0,
"namespace": "66ec5f06c05af802fd98d388",
"meta": {},
"locked_status": "unlocked",
"id": "66ec5f07c05af802fd001ffe",
"files": [
{
"url": "https://www.fake-url.com/35a66669cbb042829a48b40f4fe5ab0d",
"type": "image/svg",
"thumbnail_url": "https://www.fake-url.com/923a9afe7a3d4a01b119c9a8ae909ef5",
"size": 3949,
"platform_id": "64d11a55d7c40100075c27ff",
"metadata": {
"width": 80,
"height": 80
},
"filename": "fake_filename",
"file_id": "fake_file_id"
}
],
"creation_date": "2024-09-19",
"author": "7b1d309a153e40ef808909517fd3ec90"
}
Creates a media with a given file
Request
POST api/v1/project/{project_id}/media
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
project_id | Your project id in Sections | query_string | string | true | ||
id | The media id | query_string | string | true | ||
section | A map containing the file | body | map | true | {1: {file: 'BASE64_STRING_HERE', base64: true}} |
Responses
Status | Description | Schema |
---|---|---|
200 | Media resource | Media |
400 | Error Resource | Error |
404 | Error Resource | Error |
Renders a media
Create a page with valid section using medias ids then keep sync
GET /api/v1/project/66ec5f06c05af802fd98d388/media/66ec5f07c05af802fd001ffe
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbHcDbmlsbQAAAA9zYWFzX3Byb2plY3RfaWRsAAAAAXQAAAACbQAAAARyb2xlbQAAAARVc2VybQAAAA9zYWFzX3Byb2plY3RfaWRtAAAAGDY2ZWM1ZjA2YzA1YWY4MDJmZDk4ZDM4OGptAAAABnN0YXR1c20AAAAIdmVyaWZpZWRtAAAAB3VzZXJfaWRtAAAAIDdiMWQzMDlhMTUzZTQwZWY4MDg5MDk1MTdmZDNlYzkwbQAAAAZzdGF0dXNtAAAAB3N1Y2Nlc3NuBgD_MVMLkgFiAAFRgA.1Jw8rIbvFzB_1f_JEZp1DJMC600jT1txTNzfIohsU3s
origin: http://bda0aa0e-ef46-4847-848a-3d7a3a56d731.com
Response
200
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1TmqQtdGkMAwABALh
content-type: application/json; charset=utf-8
access-control-allow-origin: http://bda0aa0e-ef46-4847-848a-3d7a3a56d731.com
{
"type": "image",
"title": null,
"tags": null,
"seo_tag": null,
"private_status": "public",
"number_of_contents": 0,
"namespace": "66ec5f06c05af802fd98d388",
"meta": {
"content": [],
"author": "deleted_user"
},
"locked_status": "unlocked",
"id": "66ec5f07c05af802fd001ffe",
"files": [
{
"url": "https://www.fake-url.com/35a66669cbb042829a48b40f4fe5ab0d",
"type": "image/svg",
"thumbnail_url": "https://www.fake-url.com/923a9afe7a3d4a01b119c9a8ae909ef5",
"size": 3949,
"platform_id": "64d11a55d7c40100075c27ff",
"platform": {
"width": 1000,
"updated_at": 1655974869,
"number_of_medias": 0,
"namespace": "sections_app",
"name": "Global Platform",
"inserted_at": 1655974869,
"id": "64d11a55d7c40100075c27ff",
"height": 1000,
"description": "This is the only platform used for sections"
},
"metadata": {
"width": 80,
"height": 80
},
"filename": "fake_filename",
"file_id": "fake_file_id"
}
],
"creation_date": 1726766855,
"author": "7b1d309a153e40ef808909517fd3ec90"
}
Renders the media with its details.
Request
GET api/v1/project/{project_id}/media/{id}
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
project_id | Your project id in Sections | query_string | string | true | ||
id | The media id | query_string | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | Media resource | Media |
400 | Error Resource | Error |
404 | Error Resource | Error |
Renders all medias for this project.
List medias
POST /api/v1/project/66ec5f16c05af802fd9536cc/medias
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbHcDbmlsbQAAAA9zYWFzX3Byb2plY3RfaWRsAAAAAXQAAAACbQAAAARyb2xlbQAAAARVc2VybQAAAA9zYWFzX3Byb2plY3RfaWRtAAAAGDY2ZWM1ZjE2YzA1YWY4MDJmZDk1MzZjY2ptAAAABnN0YXR1c20AAAAIdmVyaWZpZWRtAAAAB3VzZXJfaWRtAAAAIDEzM2FlN2M0MDczZjRhNTU5YzU5YTlmMWI2NjljZDA2bQAAAAZzdGF0dXNtAAAAB3N1Y2Nlc3NuBgD2b1MLkgFiAAFRgA.Iyr_ZviqZNpJCKKg3rmvk0NRL8QSuPeBGROzTqQfIcU
origin: http://bb0577c3-c21d-4521-822c-b9411bd95f31.com
Response
200
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1UhY3j5oC50MABCQh
content-type: application/json; charset=utf-8
access-control-allow-origin: http://bb0577c3-c21d-4521-822c-b9411bd95f31.com
{
"total": 1,
"result": [
{
"type": "image",
"title": null,
"tags": null,
"seo_tag": null,
"private_status": "public",
"number_of_contents": 0,
"namespace": "66ec5f16c05af802fd9536cc",
"meta": {},
"locked_status": "unlocked",
"id": "66ec5f17c05af802fd308bad",
"files": [
{
"url": "https://www.fake-url.com/a41871f76ad14b59b13382c477019efa",
"type": "image/svg",
"thumbnail_url": "https://www.fake-url.com/e6db325a73014cad8bcf074e0c0b17e2",
"size": 3949,
"platform_id": "64d11a55d7c40100075c27ff",
"platform": {
"width": 1000,
"updated_at": 1655974869,
"number_of_medias": 0,
"namespace": "sections_app",
"name": "Global Platform",
"inserted_at": 1655974869,
"id": "64d11a55d7c40100075c27ff",
"height": 1000,
"description": "This is the only platform used for sections"
},
"metadata": {
"width": 80,
"height": 80
},
"filename": "fake_filename",
"file_id": "fake_file_id"
}
],
"creation_date": 1726766871,
"author": "133ae7c4073f4a559c59a9f1b669cd06"
}
]
}
Renders the medias with their details.
Request
POST api/v1/project/{project_id}/medias
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
project_id | Your project id in Sections | query_string | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | Array of Media resource | Media |
Updates a media
Create a page with valid section using medias ids then keep sync
PUT /api/v1/project/66ec5f06c05af802fd98d388/media/66ec5f07c05af802fd001ffe
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAAEbQAAAAVlbWFpbHcDbmlsbQAAAA9zYWFzX3Byb2plY3RfaWRsAAAAAXQAAAACbQAAAARyb2xlbQAAAARVc2VybQAAAA9zYWFzX3Byb2plY3RfaWRtAAAAGDY2ZWM1ZjA2YzA1YWY4MDJmZDk4ZDM4OGptAAAABnN0YXR1c20AAAAIdmVyaWZpZWRtAAAAB3VzZXJfaWRtAAAAIDdiMWQzMDlhMTUzZTQwZWY4MDg5MDk1MTdmZDNlYzkwbQAAAAZzdGF0dXNtAAAAB3N1Y2Nlc3NuBgD_MVMLkgFiAAFRgA.1Jw8rIbvFzB_1f_JEZp1DJMC600jT1txTNzfIohsU3s
origin: http://bda0aa0e-ef46-4847-848a-3d7a3a56d731.com
content-type: multipart/mixed; boundary=plug_conn_test
{
"type": "image",
"private_status": "public",
"locked_status": "unlocked",
"files": {
"1": {
"file": {
"content_type": "image/svg",
"path": "test/support/toggle.png",
"filename": "blue.svg"
}
}
}
}
Response
200
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1Tq3sycCkMAwABAth
content-type: application/json; charset=utf-8
access-control-allow-origin: http://bda0aa0e-ef46-4847-848a-3d7a3a56d731.com
{
"type": "image",
"title": null,
"tags": null,
"seo_tag": null,
"private_status": "public",
"number_of_contents": 0,
"namespace": "66ec5f06c05af802fd98d388",
"meta": {},
"locked_status": "unlocked",
"id": "66ec5f07c05af802fd001ffe",
"files": [
{
"url": "https://www.fake-url.com/6c9ed11b73224311838cdf5178c5f7c0",
"type": "image/svg",
"thumbnail_url": "https://www.fake-url.com/053bef9d029046dc83875b686e2dda32",
"size": 3949,
"platform_id": "64d11a55d7c40100075c27ff",
"metadata": {
"width": 80,
"height": 80
},
"filename": "fake_filename",
"file_id": "fake_file_id"
}
],
"creation_date": "2024-09-19",
"author": "7b1d309a153e40ef808909517fd3ec90"
}
Updates a media with a given file
Request
POST api/v1/project/{project_id}/media/{id}
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
project_id | Your project id in Sections | query_string | string | true | ||
id | The media id | query_string | string | true | ||
section | A map containing the file | body | map | true | {1: {file: 'BASE64_STRING_HERE', base64: true}} |
Responses
Status | Description | Schema |
---|---|---|
200 | Media resource | Media |
400 | Error Resource | Error |
404 | Error Resource | Error |
7. Project Management
This part will guide on how to manage your project on Sections.
Update a project
Update project
PUT /api/v1/project/66ec5f0ac05af802fd20c04c
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAACbQAAAAxyb2xlc19vYmplY3RsAAAAAXQAAAABbQAAAAV0aXRsZW0AAAALc3VwZXJfYWRtaW5qbQAAAAd1c2VyX2lkbQAAACA1YWViNjU4MzQ0YzY0OWI0ODMyNGZlYjgyMDU1M2IzM20AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYA_T9TC5IBYgABUYA.mia5Bvj4C5XdcIdUH95YJXESHyo95R179L0pahKGB0Y
pkey: $2b$12$ZIkCWW2phES7RcB7LBUXpuaYymQw.o5J.VhFy2mbjyUpDenawFyyq
content-type: multipart/mixed; boundary=plug_conn_test
{
"title": "New title 123"
}
Response
200
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1TyKd1_1dKcQABBOh
content-type: application/json; charset=utf-8
{
"updated_at": 1726766859,
"type": "private",
"title": "New title 123",
"reason": null,
"project_url": [
"http://localhost:3000",
"4e13f105-46ac-4bdf-893e-69caf7237e84.com"
],
"private_key": "$2b$12$pVHxeQl/d.7UYu8xnOvMK.9DZMXa7eF4Zl6Q4cBiLA17zx2gdalLe",
"package": "free",
"login_redirect_url": "http://localhost:3000/redirect-login",
"limitation_status": "active",
"last_req_date": null,
"inserted_at": 1726766858,
"id": "66ec5f0ac05af802fd20c04c",
"files_counter": 0,
"configured_fields": {},
"billing_status": "upgrade_lock",
"active": true,
"__meta__": {
"state": "built",
"source": "project",
"schema": "Elixir.Sections.Section.Project",
"prefix": null,
"context": null
}
}
Used to update any project field.
Notes:
- For the project_url
and login_redirect_url
fields, you can specify any of the following patterns for local testing:
- localhost:PORT with HTTP:// or HTTPS://
- Class A,B,C Private addresses with HTTP://
Request
PUT api/v1/project/:project_id/
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true | ||
origin | Request Origin | header | string | true | https://your.project.url.com | |
project | Project Model. | body | map | true | {'active' => true,'configured_fields' => {'blogs' => {'private_key' => 'xxxxxx','project_id' => 1}},'files_counter' => 0,'id' => '601bf1221907a50007ba3f81','login_redirect_url' => 'https://your.project.url.com/redirect_login/admin','package' => 'free','private_key' => 'xxxxxx','project_url' => ['https://your.project.url.com'],'reason' => nil,'type' => 'private'} |
Responses
Status | Description | Schema |
---|---|---|
200 | Project Resource | Project |
400 | Error Resource | Error |
Reset a Project's private key
Reset project private key
PUT /api/v1/project/66ec5f09c05af802fdad8c04/reset_key
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAACbQAAAAxyb2xlc19vYmplY3RsAAAAAXQAAAABbQAAAAV0aXRsZW0AAAALc3VwZXJfYWRtaW5qbQAAAAd1c2VyX2lkbQAAACA2NWVlY2QxMDhlNDM0ZjA0Yjk5OGM2MTgyNmI5Y2VhM20AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYAjTxTC5IBYgABUYA.9f3QCKe90valiiB0V0YUk2bWGay5tSKP8p00Ng24T5Q
pkey: $2b$12$.qopUuQUVRLPkEO23uTBe.Sjc8TjW4gkevOUFZDS9WXcGC6Erg/Wa
Response
200
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1TuxF8n0yyhUABBAB
content-type: application/json; charset=utf-8
{
"message": "Your project private key was successfully reset. The old one does not work anymore. Make sure to update the private key to the new one wherever you are using it."
}
Used to reset the private key field of a project.
Request
PUT api/v1/project/:project_id/reset_key
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true | ||
origin | Request Origin | header | string | true | https://your.project.url.com |
Responses
Status | Description | Schema |
---|---|---|
200 | Project Resource | Project |
400 | Error Resource | Error |
Get a project's dahsboard metrics
Get project dashboard
GET /api/v1/project/66ec5f0bc05af802fded83a7/dashboard
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAACbQAAAAxyb2xlc19vYmplY3RsAAAAAXQAAAABbQAAAAV0aXRsZW0AAAALc3VwZXJfYWRtaW5qbQAAAAd1c2VyX2lkbQAAACBlNzJkMTg2MmIzZGU0OTc5YmE3MWRlYzJhMTg0YzQwZW0AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYA50RTC5IBYgABUYA.pGmgOAmhzjnvWtBnfww8as9gj1ewEwLyF0wVWp9D-vc
pkey: $2b$12$3DlG3OYC11ud6S5FIVIMo.lnbi3tiFSuw/x3aWN4EkZHCeGa4DsS2
Response
200
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1T24miBeuepgABJYi
content-type: application/json; charset=utf-8
{
"package_name": "free",
"package_locked": false,
"max_pages": 2,
"max_media_files": 10,
"max_file_size": 500000,
"current_pages": 0,
"current_medias": 0,
"api_until_reset": 23539764,
"api_limit_use": 500,
"api_current_use": 0
}
Used to retrieve a project's dashboard metrics such as package limitations and current usage.
Request
GET api/v1/project/:project_id/dashboard
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true | ||
origin | Request Origin | header | string | true | https://your.project.url.com | |
project | Project Model. | body | map | true | {'active' => true,'configured_fields' => {'blogs' => {'private_key' => 'xxxxxx','project_id' => 1}},'files_counter' => 0,'id' => '601bf1221907a50007ba3f81','login_redirect_url' => 'https://your.project.url.com/redirect_login/admin','package' => 'free','private_key' => 'xxxxxx','project_url' => ['https://your.project.url.com'],'reason' => nil,'type' => 'private'} |
Responses
Status | Description | Schema |
---|---|---|
200 | Dashboard Resource | Dashboard |
400 | Error Resource | Error |
8. Sections Admin Only Access
This part wil guide Sections Admins on actions they only can perform.
Get projects
test pagination and filtering of projects GET /api/v1/auth/project pagination limit and start
GET /api/v1/auth/project?start=1&limit=1
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAACbQAAAAxyb2xlc19vYmplY3RsAAAAAXQAAAABbQAAAAV0aXRsZW0AAAALc3VwZXJfYWRtaW5qbQAAAAd1c2VyX2lkbQAAACBhOGQ4MjJhY2I2Mzk0ZjRhOTAxNDI2NDkyZmM4ZWZjNm0AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYAg29UC5IBYgABUYA.SDOdO21MckibXcwwEDq-bob4A30UITLr3UyJ0Bs8lSc
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1YTgsUF_lOLoABKdi
access-control-allow-origin: http://clientapp.com:3001
{
"total": 125,
"public_packages": [
{
"value": "Free",
"key": "free"
},
{
"value": "Standard",
"key": "solo"
},
{
"value": "Corporate",
"key": "corporate"
},
{
"value": "QS_enabled",
"key": "qs_enabled"
}
],
"data": [
{
"updated_at": 1726766850,
"type": "private",
"title": null,
"reason": null,
"project_url": [
"41d23b9b-6b17-4c67-80d3-4f4e996b423f.com",
"02c1129c-0bf0-48ee-b567-77dcfe2cae53.com"
],
"private_packages": [],
"package": "free",
"login_redirect_url": "https://41d23b9b-6b17-4c67-80d3-4f4e996b423f.com/redirect-login",
"limitation_status": "active",
"last_req_date": null,
"inserted_at": 1726766850,
"id": "66ec5f02c05af802fdb223e2",
"files_counter": 0,
"configured_fields": {},
"billing_status": "upgrade_lock",
"active": true,
"__meta__": {
"state": "built",
"source": "project",
"schema": "Elixir.Sections.Section.Project",
"prefix": null,
"context": null
}
}
]
}
Used to retrieve list of projects. Current supported filters are:
earliest_last_req_date: Timestamp of last_req_date as the earliest, ex:
1726766844
latest_last_req_date: Timestamp of last_req_date as the latest, ex:
1726766844
package: package name that the project subscribed to, ex:
corporate
project_url: project that has this project_url in his list, ex:
https://your.project.url.com
id: project id, ex:
628cbb71e537f4000619c0b7
full_name: last request user full name, ex:
User Full Name
email: last request user email, ex: `some_email@gmail.com
Request
POST api/v1/auth/projects
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | List of Project Resource | Project |
400 | Error Resource | Error |
Create a new package
create a package and create and existing package
POST /api/v1/auth/package
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAACbQAAAAxyb2xlc19vYmplY3RsAAAAAXQAAAABbQAAAAV0aXRsZW0AAAALc3VwZXJfYWRtaW5qbQAAAAd1c2VyX2lkbQAAACA1Mjc3N2Y4NmQ4Yjk0NjM0OWI4MWQ5MWYwNWRmYzVjYW0AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYAyAJVC5IBYgABUYA.4WLUgS8Xcsu0waC5ZIw-LwIrtYqLpWc--Nv1xttu2AE
origin: http://6f1e973d-db24-491e-9a0c-6647bcd4db00.com
content-type: multipart/mixed; boundary=plug_conn_test
{
"type": "public",
"rank": 3,
"quota": -1,
"price": 1999,
"name": "new_name",
"locked": false,
"limits": [
{
"value": -1,
"name": "query_string_support",
"label": "label"
},
{
"value": 2,
"name": "number_of_pages",
"label": "label"
},
{
"value": 1,
"name": "variation_per_page",
"label": "label"
},
{
"value": 10,
"name": "static_sections",
"label": "label"
},
{
"value": 5,
"name": "sections_total",
"label": "label"
},
{
"value": 10,
"name": "hosted_files",
"label": "label"
},
{
"value": 500000,
"name": "size_per_file",
"label": "label"
},
{
"value": 10,
"name": "api_limit_sec",
"label": "label"
},
{
"value": 100,
"name": "api_limit_minute",
"label": "label"
},
{
"value": 100,
"name": "api_limit_hour",
"label": "label"
},
{
"value": 500,
"name": "api_limit_day",
"label": "label"
},
{
"value": -1,
"name": "dynamic_section_types_support",
"label": "label"
},
{
"value": 2,
"name": "users",
"label": "label"
},
{
"value": 5,
"name": "domains",
"label": "label"
}
],
"label": "Free"
}
Response
400
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1agFkIGpC7VYABE6B
access-control-allow-origin: http://clientapp.com:3001
{
"message": "Packages already exist"
}
Used to create a package
Request
POST api/v1/auth/package
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | Package Resource | Package |
400 | Error Resource | Error |
Get package by id
Get package by ID
GET /api/v1/auth/package/66ec5f7dc05af802fd3fa855
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAACbQAAAAxyb2xlc19vYmplY3RsAAAAAXQAAAABbQAAAAV0aXRsZW0AAAALc3VwZXJfYWRtaW5qbQAAAAd1c2VyX2lkbQAAACA4YTBkZjlhOTM4ZWY0NGFhYWQ2OTZmMTliNTRkMzkxZm0AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYAsf9UC5IBYgABUYA.gufNiN2BDRG8YifDUuGnJURqa_c9cSWGBdnjuRSUBK4
origin: http://1a79a4a1-2a6d-425a-901c-e4e6e1295a43.com
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1adI6XdytmhYABE2B
access-control-allow-origin: http://clientapp.com:3001
{
"type": "public",
"rank": 3,
"quota": -1,
"price": 1999,
"name": "package_by_id",
"locked": false,
"limits": [
{
"value": -1,
"name": "query_string_support"
},
{
"value": 2,
"name": "number_of_pages"
},
{
"value": 1,
"name": "variation_per_page"
},
{
"value": 10,
"name": "static_sections"
},
{
"value": 5,
"name": "sections_total"
},
{
"value": 10,
"name": "hosted_files"
},
{
"value": 500000,
"name": "size_per_file"
},
{
"value": 10,
"name": "api_limit_sec"
},
{
"value": 100,
"name": "api_limit_minute"
},
{
"value": 100,
"name": "api_limit_hour"
},
{
"value": 500,
"name": "api_limit_day"
},
{
"value": -1,
"name": "dynamic_section_types_support"
},
{
"value": 2,
"name": "users"
},
{
"value": 5,
"name": "domains"
}
],
"label": "Free",
"id": "66ec5f7dc05af802fd3fa855"
}
Used to retrieve a package by its id.
Request
GET api/v1/auth/package/:id
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | Package Resource | Package |
400 | Error Resource | Error |
404 | Error Resource | Error |
Edit package by id
UPDATE package/
PUT /api/v1/auth/package/66ec5f79c05af802fd95706a
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAACbQAAAAxyb2xlc19vYmplY3RsAAAAAXQAAAABbQAAAAV0aXRsZW0AAAALc3VwZXJfYWRtaW5qbQAAAAd1c2VyX2lkbQAAACBmZDAyZWUzZWNhOTQ0ZjE0OTBjMWVmNmY2OGUxYTk0Y20AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYAp-9UC5IBYgABUYA._0Q8OOTNYNIEsHkDobZ0jwer8jO2XoO9TTk-yxh9fM0
origin: http://01d34ae4-bae7-4cdb-a15f-7c2bbdc7249d.com
content-type: multipart/mixed; boundary=plug_conn_test
{
"name": "premium",
"limits": [
{
"value": -1,
"name": "query_string_support",
"label": "label"
},
{
"value": 20,
"name": "number_of_pages",
"label": "label"
},
{
"value": 1,
"name": "variation_per_page",
"label": "label"
},
{
"value": 10,
"name": "static_sections",
"label": "label"
},
{
"value": 5,
"name": "sections_total",
"label": "label"
},
{
"value": 7,
"name": "hosted_files",
"label": "label"
},
{
"value": 500000,
"name": "size_per_file",
"label": "label"
},
{
"value": 10,
"name": "api_limit_sec",
"label": "label"
},
{
"value": -1,
"name": "api_limit_hour",
"label": "label"
},
{
"value": 100,
"name": "api_limit_minute",
"label": "label"
},
{
"value": 500,
"name": "api_limit_day",
"label": "label"
},
{
"value": -1,
"name": "dynamic_section_types_support",
"label": "label"
},
{
"value": 2,
"name": "users",
"label": "label"
},
{
"value": 5,
"name": "domains",
"label": "label"
}
],
"label": "premium"
}
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1aN2AzUBE7ugABEqB
access-control-allow-origin: http://clientapp.com:3001
{
"type": "public",
"rank": 3,
"quota": -1,
"price": 1999,
"name": "premium",
"locked": false,
"limits": [
{
"value": -1,
"name": "query_string_support"
},
{
"value": 20,
"name": "number_of_pages"
},
{
"value": 1,
"name": "variation_per_page"
},
{
"value": 10,
"name": "static_sections"
},
{
"value": 5,
"name": "sections_total"
},
{
"value": 7,
"name": "hosted_files"
},
{
"value": 500000,
"name": "size_per_file"
},
{
"value": 10,
"name": "api_limit_sec"
},
{
"value": -1,
"name": "api_limit_hour"
},
{
"value": 100,
"name": "api_limit_minute"
},
{
"value": 500,
"name": "api_limit_day"
},
{
"value": -1,
"name": "dynamic_section_types_support"
},
{
"value": 2,
"name": "users"
},
{
"value": 5,
"name": "domains"
}
],
"label": "premium",
"id": "66ec5f79c05af802fd95706a"
}
Used to edit a package by its id.
Request
PUT api/v1/auth/package/:id
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true | ||
package_id | The package id in Sections | query_string | string | true |
Responses
Status | Description | Schema |
---|---|---|
200 | Package Resource | Package |
400 | Error Resource | Error |
404 | Error Resource | Error |
Duplicate package by id
Duplicate package
POST /api/v1/auth/package/66ec5f7ec05af802fdf0a5e5/duplicate
token: SFMyNTY.g2gDdAAAAAJtAAAABGRhdGF0AAAAAW0AAAAEdXNlcnQAAAACbQAAAAxyb2xlc19vYmplY3RsAAAAAXQAAAABbQAAAAV0aXRsZW0AAAALc3VwZXJfYWRtaW5qbQAAAAd1c2VyX2lkbQAAACA3Yzg5YTUxNDBiMjQ0YmE3ODU0Y2JhOTk4YzFmZjIzNG0AAAAGc3RhdHVzbQAAAAdzdWNjZXNzbgYAZQRVC5IBYgABUYA.28NEWc2BsBHJs25kNlW2lAU20AYHTQ1allEOxC7iI4Q
origin: http://d2698337-4df4-406c-b8b1-9878db2dd8a9.com
content-type: multipart/mixed; boundary=plug_conn_test
{
"name": "package 2"
}
Response
200
content-type: application/json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: F_a1ahorOpIfRw0ABE8h
access-control-allow-origin: http://clientapp.com:3001
{
"type": "public",
"rank": 3,
"quota": -1,
"price": 1999,
"name": "package 2",
"locked": false,
"limits": [
{
"value": -1,
"name": "query_string_support"
},
{
"value": 2,
"name": "number_of_pages"
},
{
"value": 1,
"name": "variation_per_page"
},
{
"value": 10,
"name": "static_sections"
},
{
"value": 5,
"name": "sections_total"
},
{
"value": 10,
"name": "hosted_files"
},
{
"value": 500000,
"name": "size_per_file"
},
{
"value": 10,
"name": "api_limit_sec"
},
{
"value": 100,
"name": "api_limit_minute"
},
{
"value": 100,
"name": "api_limit_hour"
},
{
"value": 500,
"name": "api_limit_day"
},
{
"value": -1,
"name": "dynamic_section_types_support"
},
{
"value": 2,
"name": "users"
},
{
"value": 5,
"name": "domains"
}
],
"label": "Free",
"id": "66ec5f7ec05af802fdf0a5e6"
}
Used to duplicate a package by its id.
Request
GET api/v1/auth/package/:id/duplicate
Parameters
Parameter | Description | In | Type | Required | Default | Example |
---|---|---|---|---|---|---|
token | Sections Token | header | string | true | ||
name | Name of the package to be used when duplicating | body | string | true | Eweev Package #1 |
Responses
Status | Description | Schema |
---|---|---|
200 | Package Resource | Package |
400 | Error Resource | Error |
404 | Error Resource | Error |