$ curl https://api.fridgecms.com/v1/oauth/token \
-d grant_type="client_credentials" \
-d client_id="sk_xxxxxxxxxxx" \
-d client_secret="xxxxxxxxxxx"
const Fridge = require('fridge')
const fridge = new Fridge({
client_id: 'sk_xxxxxxxxxxx',
client_secret: 'xxxxxxxxxxxx'
})
require 'fridge_api'
fridge = FridgeApi.client({
:client_id => "sk_xxxxxxxxxxx"
:client_secret => "xxxxxxxxxxx"
})
$fridge = new \FridgeApi\Client("sk_xxxxxxxxxxx", "xxxxxxxxxxx");
Example Response:
{
"access_token": "36334bb25b63b843754b34057f4ea66756fbc14d",
"expires_in": 3600,
"token_type": "Bearer",
"scope": null
}
The Fridge API uses OAuth 2.0 to facilitate authentication. You provide the public/private key and secret to retrieve an access token that can be used to make requests. You can manage API keys on the settings page for any site you have administrator privileges.
API clients will take care of getting an access token for you. You only need to provide your key and secret when creating the client.
You must replace `client_id` and `client_secret` with the keys provided in your site settings.
$ curl https://api.fridgecms.com/v1/sites \
-X POST \
-d name="Website"
const Fridge = require('fridge')
const fridge = new Fridge({
client_id: 'sk_xxxxxxxxxxx',
client_secret: 'xxxxxxxxxxxx'
})
fridge.post('sites', {
'name': 'Website'
})
require 'fridge_api'
fridge = FridgeApi.client({
:client_id => "sk_xxxxxxxxxxx"
:client_secret => "xxxxxxxxxxx"
})
site = fridge.post("sites", {
:name => "My Website"
})
$fridge = new \FridgeApi\Client("sk_xxxxxxxxxxx", "xxxxxxxxxxx");
$fridge->post("sites", array(
"name" => "Website"
));
Example Response:
{
"id": 1,
"name": "Website",
"date_created": "2015-01-01 01:00:00",
"date_updated": "2015-01-01 01:00:00",
"endpoints": [],
"clients": [],
"webhooks": []
}
Creates a new site. A default set of API keys will be generated and you will be
added to the reserved Admin
User Role of the new site.
nameREQUIRED | The name of the site. |
webhooks | An array of URLs that will be sent a POST request upon site actions. |
endpointsExperimental | An array of URLs that will be whitelisted for providing API access. |
POST https://api.fridgecms.com/v1/sites
$ curl https://api.fridgecms.com/v1/sites/1
const Fridge = require('fridge')
const fridge = new Fridge({
client_id: 'sk_xxxxxxxxxxx',
client_secret: 'xxxxxxxxxxxx'
})
const site = fridge.get('sites/1')
require 'fridge_api'
fridge = FridgeApi.client({
:client_id => "sk_xxxxxxxxxxx"
:client_secret => "xxxxxxxxxxx"
})
site = fridge.get("sites/1")
$fridge = new \FridgeApi\Client("sk_xxxxxxxxxxx", "xxxxxxxxxxx");
$fridge->get("sites/1");
Example Response:
{
"id": 1,
"name": "Website",
"date_created": "2015-01-01 01:00:00",
"date_updated": "2015-01-01 01:00:00",
"endpoints": [],
"clients": [],
"webhooks": []
}
Retrieve the details of an existing site. You must supply the unique site id.
:idREQUIRED | The id of the site to retrieve. |
GET https://api.fridgecms.com/v1/sites/:id
$ curl https://api.fridgecms.com/v1/sites/1 \
-X PUT \
-d webhooks[]="http://example.com"
const Fridge = require('fridge')
const fridge = new Fridge({
client_id: 'sk_xxxxxxxxxxx',
client_secret: 'xxxxxxxxxxxx'
})
fridge.put('sites/1', {
'webhooks': [
'http://example.com'
]
})
require 'fridge_api'
fridge = FridgeApi.client({
:client_id => "sk_xxxxxxxxxxx"
:client_secret => "xxxxxxxxxxx"
})
site = fridge.get("sites/1")
site.webhooks = ["http://example.com"]
fridge.put("sites/1", site.commit())
$fridge = new \FridgeApi\Client("sk_xxxxxxxxxxx", "xxxxxxxxxxx");
$fridge->put("sites/1", array(
"webhooks" => array("http://example.com")
));
Example Response:
{
"id": 1,
"name": "Website",
"date_created": "2015-01-01 01:00:00",
"date_updated": "2015-01-01 01:00:00",
"endpoints": [],
"clients": [],
"webhooks": [
"http://example.com"
]
}
Updates the specified site by setting the values of the paramters passed.
name | The name of the site. |
webhooks | An array of URLs that will be sent a POST request upon site actions. |
endpointsExperimental | An array of URLs that will be whitelisted for providing API access. |
PUT https://api.fridgecms.com/v1/sites/:id
$ curl https://api.fridgecms.com/v1/sites/1 \
-X DELETE
const Fridge = require('fridge')
const fridge = new Fridge({
client_id: 'sk_xxxxxxxxxxx',
client_secret: 'xxxxxxxxxxxx'
})
fridge.delete('sites/1')
require 'fridge_api'
fridge = FridgeApi.client({
:client_id => "sk_xxxxxxxxxxx"
:client_secret => "xxxxxxxxxxx"
})
fridge.delete("sites/1")
$fridge = new \FridgeApi\Client("sk_xxxxxxxxxxx", "xxxxxxxxxxx");
$fridge->delete("sites/1");
Example Response:
{
"status": 200
}
Permanently deletes a site. It cannot be undone.
All content, settings, and users belonging to the specified site are also permanently deleted.
idREQUIRED | The ID of the site to be deleted. |
DELETE https://api.fridgecms.com/v1/sites/:id
$ curl https://api.fridgecms.com/v1/sites
const Fridge = require('fridge')
const fridge = new Fridge({
client_id: 'sk_xxxxxxxxxxx',
client_secret: 'xxxxxxxxxxxx'
})
fridge.get('sites')
require 'fridge_api'
fridge = FridgeApi.client({
:client_id => "sk_xxxxxxxxxxx"
:client_secret => "xxxxxxxxxxx"
})
sites = fridge.get("sites")
$fridge = new \FridgeApi\Client("sk_xxxxxxxxxxx", "xxxxxxxxxxx");
$fridge->get("sites");
Example Response:
[
{
"id": 1,
"name": "Website",
"date_created": "2015-01-01 01:00:00",
"date_updated": "2015-01-01 01:00:00",
"endpoints": [],
"clients": [],
"webhooks": []
},
{
"id": 2,
"name": "Other Website",
"date_created": "2015-01-01 01:00:00",
"date_update": "2015-01-01 01:00:00",
"endpoints": [],
"clients": [],
"webhooks": []
}
]
Retrieve a list of sites.
GET https://api.fridgecms.com/sites
$ curl https://api.fridgecms.com/v1/sites/1/regenerate_keys \
-X PUT
const Fridge = require('fridge')
const fridge = new Fridge({
client_id: 'sk_xxxxxxxxxxx',
client_secret: 'xxxxxxxxxxxx'
})
fridge.put('sites/1/regenerate_keys')
require 'fridge_api'
fridge = FridgeApi.client({
:client_id => "sk_xxxxxxxxxxx"
:client_secret => "xxxxxxxxxxx"
})
site = fridge.put("sites/1/regenerate_keys")
$fridge = new \FridgeApi\Client("sk_xxxxxxxxxxx", "xxxxxxxxxxx");
$fridge->put("sites/1/regenerate_keys");
Example Response:
{
"id": 1,
"name": "Website",
"date_created": "2015-01-01 01:00:00",
"date_updated": "2015-01-01 01:00:00",
"endpoints": [],
"clients": [
{
"key": "pk_xxxxxxxxxxx",
"secret": "",
"type": "public"
},
{
"key": "sk_xxxxxxxxxxx",
"secret": "xxxxxxxxxxx",
"type": "private"
}
],
"webhooks": []
}
Deletes existing API keys and creates a new public key and private key/secret pair.
idREQUIRED | The ID of the site. |
PUT https://api.fridgecms.com/sites/:id/regenerate_keys
$ curl https://api.fridgecms.com/v1/types \
-X POST \
-d site=1 \
-d name="Post" \
-d parts[]={"name":"title","label":"Title","type":"text"}
const Fridge = require('fridge')
const fridge = new Fridge({
client_id: 'sk_xxxxxxxxxxx',
client_secret: 'xxxxxxxxxxxx'
})
fridge.post('types', {
'site': 1,
'name': 'Post',
'parts': [
{
'name': 'title',
'label': 'Title',
'type': 'text'
}
]
})
require 'fridge_api'
fridge = FridgeApi.client({
:client_id => "sk_xxxxxxxxxxx"
:client_secret => "xxxxxxxxxxx"
})
content_type = fridge.post("types", {
:name => "Post",
:parts => [
{
:name => "title",
:label => "Title",
:type => "text"
}
]
})
$fridge = new \FridgeApi\Client("sk_xxxxxxxxxxx", "xxxxxxxxxxx");
$fridge->post("types", array(
"site" => 1,
"name" => "Post",
"parts" => array(
array(
"name" => "title",
"label" => "Title",
"type" => "text"
))
));
Example Response:
{
"id": 3,
"site_id": 1,
"name": "Post",
"slug": "post",
"collection": true,
"date_created": "2015-01-01 01:00:00",
"date_updated": "2015-01-01 01:00:00",
"display_order": 0,
"options": {
"layout": "default",
"api_access": true,
"sort_order": "desc",
"sort_method": "date_created"
},
"parts": [
{
"name": "title",
"label": "Title",
"type": "text"
}
]
}
siteREQUIRED | The id of the site where the content type will be created. |
nameREQUIRED | The name of the content type. |
display_order | A 0-based number specifying the default order in which the content type is listed. |
options | An object of key/value pair options. |
partsREQUIRED | An array of part definition objects. |
POST https://api.fridgecms.com/v1/types
$ curl https://api.fridgecms.com/v1/types/3?site=1
const Fridge = require('fridge')
const fridge = new Fridge({
client_id: 'sk_xxxxxxxxxxx',
client_secret: 'xxxxxxxxxxxx'
})
fridge.get('types/3?site=1')
Coming soon...
$fridge = new \FridgeApi\Client("sk_xxxxxxxxxxx", "xxxxxxxxxxx");
$fridge->get("types/3?site=1");
Retrieve the details of an existing content type. You must supply the unique content type id or slug.
siteREQUIRED | The id of the site where the content type belongs. |
:identifierREQUIRED | The id or slug of the content type to retrieve. |
GET https://api.fridgecms.com/v1/types/:identifier
$ curl https://api.fridgecms.com/v1/types/3 \
-X PUT \
-d site=1 \
-d name="Post" \
-d parts[]={"name":"published","label":"Publish Date","type":"date"}
const Fridge = require('fridge')
const fridge = new Fridge({
client_id: 'sk_xxxxxxxxxxx',
client_secret: 'xxxxxxxxxxxx'
})
fridge.put('types/3', {
'site': 1,
'name': 'Post',
'parts': [
{
'name': 'title',
'label': 'Title',
'type': 'text'
},
{
'name': 'published',
'label': 'Publish Date',
'type': 'date'
}
]
})
require 'fridge_api'
fridge = FridgeApi.client({
:client_id => "sk_xxxxxxxxxxx"
:client_secret => "xxxxxxxxxxx"
})
content_type = fridge.put("types/3", {
:name => "Post",
:parts => [
{
:name => "title",
:label => "Title",
:type => "text"
},
{
:name => "published",
:label => "Published",
:type => "date"
}
]
})
$fridge = new \FridgeApi\Client("sk_xxxxxxxxxxx", "xxxxxxxxxxx");
$fridge->put("types/3", array(
"site" => 1,
"name" => "Post",
"parts" => array(
array(
"name" => "title",
"label" => "Title",
"type" => "text"
),
array(
"name" => "published",
"label" => "Publish Date",
"type" => "date"
))
));
Example Response:
{
"id": 3,
"site_id": 1,
"name": "Post",
"slug": "post",
"collection": true,
"date_created": "2015-01-01 01:00:00",
"date_updated": "2015-01-01 01:00:00",
"display_order": 0,
"options": {
"layout": "default",
"api_access": true,
"sort_order": "desc",
"sort_method": "date_created"
},
"parts": [
{
"name": "title",
"label": "Title",
"type": "text"
},
{
"name": "published",
"label": "Publish Date",
"type": "date"
}
]
}
Updates the specified content type by setting the values of the parameters passed.
siteREQUIRED | The id of the site where the content type belongs. |
name | The name of the content type. |
display_order | A 0-based number specifying the default order in which the content type is listed. |
options | An object of key/value pair options. |
partsREQUIRED | An array of part definition objects. |
PUT https://api.fridgecms.com/v1/types/:identifier
$ curl https://api.fridgecms.com/v1/types/3 \
-X DELETE \
-d site=1
const Fridge = require('fridge')
const fridge = new Fridge({
client_id: 'sk_xxxxxxxxxxx',
client_secret: 'xxxxxxxxxxxx'
})
fridge.delete('types/3', {
'site': 1
})
require 'fridge_api'
fridge = FridgeApi.client({
:client_id => "sk_xxxxxxxxxxx"
:client_secret => "xxxxxxxxxxx"
})
fridge.delete("types/3")
$fridge = new \FridgeApi\Client("sk_xxxxxxxxxxx", "xxxxxxxxxxx");
$fridge->delete("types/3", array(
"site" => 1
));
Example Response:
{
"status": 200
}
Permanently deletes a content type. It cannot be undone.
siteREQUIRED | The id of the site where the content type belongs. |
idREQUIRED | The id of the content type. |
DELETE https://api.fridgecms.com/v1/types/:id
$ curl https://api.fridgecms.com/v1/types
const Fridge = require('fridge')
const fridge = new Fridge({
client_id: 'sk_xxxxxxxxxxx',
client_secret: 'xxxxxxxxxxxx'
})
fridge.get('types')
require 'fridge_api'
fridge = FridgeApi.client({
:client_id => "sk_xxxxxxxxxxx"
:client_secret => "xxxxxxxxxxx"
})
types = fridge.get("types")
$fridge = new \FridgeApi\Client("sk_xxxxxxxxxxx", "xxxxxxxxxxx");
$fridge->get("types");
Example Response:
[
{
"id": 3,
"site_id": 1,
"name": "Post",
"slug": "post",
"collection": true,
"date_created": "2015-01-01 01:00:00",
"date_updated": "2015-01-01 01:00:00",
"display_order": 0,
"options": {
"layout": "default",
"api_access": true,
"sort_order": "desc",
"sort_method": "date_created"
},
"parts": [
{
"name": "title",
"label": "Title",
"type": "text"
}
]
},
{
"id": 4,
"site_id": 1,
"name": "Event",
"date_created": "2015-01-01 01:00:00",
"date_updated": "2015-01-01 01:00:00",
"display_order": 1,
"options": {},
"parts": [
{
"id": 12,
"name": "location",
"label": "Location",
"hint": "Where the event will be held",
"type": "text",
"required": true
}
]
}
]
Retrieve a list of content types.
siteREQUIRED | The id of the site. |
GET https://api.fridgecms.com/v1/types
$ curl https://api.fridgecms.com/v1/content/type/post \
-X POST \
-d site=1 \
-d content[title]="My Post Title" \
-d content[published]="2015-02-01" \
-d active=1
const Fridge = require('fridge')
const fridge = new Fridge({
client_id: 'sk_xxxxxxxxxxx',
client_secret: 'xxxxxxxxxxxx'
})
fridge.post('content/type/post', {
'site': 1,
'content': {
'title': 'My Post Title',
'published': '2015-02-01'
},
'active': 1
})
require 'fridge_api'
fridge = FridgeApi.client({
:client_id => "sk_xxxxxxxxxxx"
:client_secret => "xxxxxxxxxxx"
})
post = fridge.post("content/type/post", {
:content => {
:title => "My Post Title",
:published => "2015-02-01"
},
:active => true
})
$fridge = new \FridgeApi\Client("sk_xxxxxxxxxxx", "xxxxxxxxxxx");
$fridge->post("content/type/post", array(
"site" => 1,
"content" => array(
"title" => "My Post Title",
"published" => "2015-02-01"
),
"active" => 1
));
Example Response:
{
"id": 15,
"site_id": 1,
"document_definition_id": 3,
"date_created": "2015-02-01 01:00:00",
"date_updated": "2015-02-01 01:00:00",
"display_order": 0,
"active": 1,
"content": {
"10": "My Post Title",
"11": "2015-02-01"
},
"slug": "my_post_title",
"user_id": 90
}
Creates a new content item.
siteREQUIRED | The id of the site where the content will be created. |
:identifierREQUIRED | The id or slug of the content type used to create the content item. The name of the content type. |
activedefault is true | Boolean value indicates if the content item is active or not. |
slug | A unique slug identifier for the content item. One will be intelligently generated for you if not specified. |
contentREQUIRED | An array or hash of content values paired to part definition identifiers. |
POST https://api.fridgecms.com/v1/content/type/:identifier
$ curl https://api.fridgecms.com/v1/content/15 \
-d site=1
const Fridge = require('fridge')
const fridge = new Fridge({
client_id: 'sk_xxxxxxxxxxx',
client_secret: 'xxxxxxxxxxxx'
})
fridge.get('content/15', {
'site': 1
})
require 'fridge_api'
fridge = FridgeApi.client({
:client_id => "sk_xxxxxxxxxxx"
:client_secret => "xxxxxxxxxxx"
})
post = fridge.get("content/15")
$fridge = new \FridgeApi\Client("sk_xxxxxxxxxxx", "xxxxxxxxxxx");
$fridge->get("content/15", array(
"site" => 1
));
Example Response:
{
"id": 15,
"site_id": 1,
"document_definition_id": 3,
"date_created": "2015-02-01 01:00:00",
"date_updated": "2015-02-01 01:00:00",
"display_order": 0,
"active": 1,
"content": {
"10": "My Post Title",
"11": "2015-02-01"
},
"slug": "my_post_title",
"user_id": 90
}
Retrieve the details of an existing content item. You must supply the unique site id and content id.
siteREQUIRED | The id of the site where the content belongs. |
:identifierREQUIRED | The id or slug of the content item. |
GET https://api.fridgecms.com/v1/content/:identifier
$ curl https://api.fridgecms.com/v1/content/15 \
-X PUT \
-d site=1 \
-d content[title]="Draft Title" \
-d active=0
const Fridge = require('fridge')
const fridge = new Fridge({
client_id: 'sk_xxxxxxxxxxx',
client_secret: 'xxxxxxxxxxxx'
})
fridge.put('content/15', {
'site': 1,
'content': {
'title': 'Draft Title',
'published': '2015-02-01'
},
'active': 0
})
require 'fridge_api'
fridge = FridgeApi.client({
:client_id => "sk_xxxxxxxxxxx"
:client_secret => "xxxxxxxxxxx"
})
post = fridge.put("content/15", {
:content => {
:title => "Draft Title",
:published => "2015-02-01"
},
:active => false
})
$fridge = new \FridgeApi\Client("sk_xxxxxxxxxxx", "xxxxxxxxxxx");
$fridge->put("content/15", array(
"site" => 1,
"content" => array(
"title" => "Draft Title",
"published" => "2015-02-01"
),
"active" => 0
));
Example Response:
{
"id": 15,
"site_id": 1,
"document_definition_id": 3,
"date_created": "2015-02-01 01:00:00",
"date_updated": "2015-02-01 01:00:00",
"display_order": 0,
"active": false,
"content": {
"10": "Draft Title",
"11": "2015-02-01"
},
"slug": "my_post_title",
"user_id": 90
}
Updates the specified content item by setting the values of the parameters passed.
siteREQUIRED | The id of the site where the content will be created. |
:identifierREQUIRED | The id or slug of the content type used to create the content item. The name of the content type. |
activedefault is true | Boolean value indicates if the content item is active or not. |
slug | A unique slug identifier for the content item. One will be intelligently generated for you if not specified. |
contentREQUIRED | An array or hash of content values paired to part definition identifiers. |
PUT https://api.fridgecms.com/v1/content/:identifier
$ curl https://api.fridgecms.com/v1/content/15 \
-X DELETE \
-d site=1
const Fridge = require('fridge')
const fridge = new Fridge({
client_id: 'sk_xxxxxxxxxxx',
client_secret: 'xxxxxxxxxxxx'
})
fridge.delete('content/15', {
'site': 1
})
require 'fridge_api'
fridge = FridgeApi.client({
:client_id => "sk_xxxxxxxxxxx"
:client_secret => "xxxxxxxxxxx"
})
fridge.delete("content/15")
$fridge = new \FridgeApi\Client("sk_xxxxxxxxxxx", "xxxxxxxxxxx");
$fridge->delete("content/15", array(
"site" => 1
));
Example Response:
{
"status": 200
}
Permanently deletes a content item. It cannot be undone.
siteREQUIRED | The id of the site. |
:identifierREQUIRED | The id of the content. |
DELETE https://api.fridgecms.com/v1/content/:identifier
$ curl https://api.fridgecms.com/v1/content?type=post&site=1
const Fridge = require('fridge')
const fridge = new Fridge({
client_id: 'sk_xxxxxxxxxxx',
client_secret: 'xxxxxxxxxxxx'
})
fridge.get('content?type=post&site=1')
require 'fridge_api'
fridge = FridgeApi.client({
:client_id => "sk_xxxxxxxxxxx"
:client_secret => "xxxxxxxxxxx"
})
posts = fridge.get("content", {type: "post"})
$fridge = new \FridgeApi\Client("sk_xxxxxxxxxxx", "xxxxxxxxxxx");
$fridge->get("content?type=post&site=1");
Example Response:
[
{
"id": 15,
"site_id": 1,
"document_definition_id": 3,
"date_created": "2015-02-01 01:00:00",
"date_updated": "2015-02-01 01:00:00",
"display_order": 0,
"active": 1,
"content": {
"10": "My Post Title",
"11": "2015-02-01"
},
"slug": "my_post_title",
"user_id": 90
}
]
Retrieve a list of content.
siteREQUIRED | The id of the site. |
type | The id or slug of a content type to filter by. |
active | true or false or all . Filters content by active, inactive, or both. |
limit | A number which limits the amount of content retrieved. |
offset | A number which offsets the start of content retrieved. |
sort_methoddefault is date_created or the sort method of the content type | Specify how content is sorted. Options are date_created , manual , hierarchy , or any valid part name. |
sort_order | Specify the direction of the sort. asc or desc |
{part_name} | Any part name/part value pair to filter by. |
GET https://api.fridgecms.com/v1/content
$ curl https://api.fridgecms.com/v1/content/upload -F file=@/path/to/filename.jpg -H "Authorization: token xxxxxxxxxxx" -d site=1
const Fridge = require('fridge')
const fridge = new Fridge({
client_id: 'sk_xxxxxxxxxxx',
client_secret: 'xxxxxxxxxxxx'
})
fridge.post('content/upload', {
'site': 1,
'file': 'file'
})
require 'fridge_api'
fridge = FridgeApi.client({
:client_id => "sk_xxxxxxxxxxx"
:client_secret => "xxxxxxxxxxx"
})
fridge.post("content/upload", {:file => file})
$fridge = new \FridgeApi\Client("sk_xxxxxxxxxxx", "xxxxxxxxxxx");
$fridge->post("content/upload", array(
"site" => 1,
"file" => "file"
));
Example Response:
{
"message": "filename.jpg",
"status": 200
}
Upload a file asset to the specified site.
siteREQUIRED | The id of the site. |
fileREQUIRED | The file to upload. |
POST https://api.fridgecms.com/v1/content/upload
$ curl https://api.fridgecms.com/v1/content/upload/my_filename.txt \
-d site=1
const Fridge = require('fridge')
const fridge = new Fridge({
client_id: 'sk_xxxxxxxxxxx',
client_secret: 'xxxxxxxxxxxx'
})
fridge.get('content/upload/my_filename.txt', {
'site': 1
})
require 'fridge_api'
fridge = FridgeApi.client({
:client_id => "sk_xxxxxxxxxxx"
:client_secret => "xxxxxxxxxxx"
})
file = fridge.get("content/upload/my_filename.txt")
$fridge = new \FridgeApi\Client("sk_xxxxxxxxxxx", "xxxxxxxxxxx");
$fridge->get("content/upload/my_filename.txt", array(
"site" => 1
));
Example Response:
"Binary"
Retrieve an existing file. The file is sent as binary with proper Content-Type
headers. You must supply the unique site id and filename.
siteREQUIRED | The id of the site. |
:filenameREQUIRED | The name of the file. |
GET https://api.fridgecms.com/v1/content/upload/:filename
$ curl https://api.fridgecms.com/v1/public/post \
-d site=1 \
-d content[title]="User submitted post" \
-d content[published]="2015-02-02" \
-d active=1
const Fridge = require('fridge')
const fridge = new Fridge({
client_id: 'sk_xxxxxxxxxxx',
client_secret: 'xxxxxxxxxxxx'
})
fridge.post('public/post', {
'site': 1,
'content': {
'title': 'User submitted post',
'published': '2015-02-01'
},
'active': 1
})
require 'fridge_api'
fridge = FridgeApi.client({
:client_id => "sk_xxxxxxxxxxx"
:client_secret => "xxxxxxxxxxx"
})
post = fridge.post("public/post", {
:content => {
:title => "User submitted post",
:published => "2015-02-02"
},
:active => true
})
$fridge = new \FridgeApi\Client("sk_xxxxxxxxxxx", "xxxxxxxxxxx");
$fridge->post("public/post", array(
"site" => 1,
"content" => array(
"title" => "User submitted post",
"published" => "2015-02-01"
),
"active" => 1
));
Example Response:
{
"id": 23,
"site_id": 1,
"document_definition_id": 3,
"date_created": "2015-02-01 01:00:00",
"date_updated": "2015-02-01 01:00:00",
"display_order": 0,
"active": 1,
"content": {
"10": "User submitted post",
"11": "2015-02-01"
},
"slug": "user_submitted_post"
}
If a content type allows for public content creation by setting the api_create
option to true
, a valid public key authorized token can create content.
:typeREQUIRED | The id or slug of the content type used to create the content. |
contentREQUIRED | An array or hash of content values paired to part definition identifiers. |
POST https://api.fridgecms.com/v1/public/:type
$ curl https://api.fridgecms.com/v1/roles \
-X POST \
-d site=1 \
-d name="Member" \
-d parts[]={"name":"avatar","label":"Avatar","type":"image"}
const Fridge = require('fridge')
const fridge = new Fridge({
client_id: 'sk_xxxxxxxxxxx',
client_secret: 'xxxxxxxxxxxx'
})
fridge.post('roles', {
'site': 1,
'name': 'Member',
'parts': [
{
'name': 'avatar',
'label': 'Avatar',
'type': 'image'
}
]
})
require 'fridge_api'
fridge = FridgeApi.client({
:client_id => "sk_xxxxxxxxxxx"
:client_secret => "xxxxxxxxxxx"
})
member_role = fridge.post("roles", {
:name => "Member",
:parts => [
{
:name => "avatar",
:label => "Avatar",
:type => "image"
}
]
})
$fridge = new \FridgeApi\Client("sk_xxxxxxxxxxx", "xxxxxxxxxxx");
$fridge->post("roles", array(
"site" => 1,
"name" => "Member",
"parts" => array(
array(
"name" => "avatar",
"label" => "Avatar",
"type" => "image"
))
));
Example Response:
{
"id": 7,
"site_id": 1,
"name": "Member",
"slug": "member",
"date_created": "2015-01-01 01:00:00",
"date_updated": "2015-01-01 01:00:00",
"display_order": 0,
"options": {},
"parts": [
{
"name": "photo",
"label": "Photo",
"type": "image"
}
],
"admin_access": false,
"permissions": {}
}
Creates a new user role.
siteREQUIRED | The id of the site where the user role will be created. |
nameREQUIRED | The name of the user role. |
display_order | A 0-based number specifying the default order in which the content type is listed. |
options | An object of key/value pair options. |
partsREQUIRED | An array of part definition objects. |
admin_accessAdmins only | Control if this role has access to the Fridge dashboard. |
permissionsAdmins only | An object of role-based permissions |
POST https://api.fridgecms.com/v1/roles
$ curl https://api.fridgecms.com/v1/roles/member?site=1
const Fridge = require('fridge')
const fridge = new Fridge({
client_id: 'sk_xxxxxxxxxxx',
client_secret: 'xxxxxxxxxxxx'
})
fridge.get('roles/member?site=1')
require 'fridge_api'
fridge = FridgeApi.client({
:client_id => "sk_xxxxxxxxxxx"
:client_secret => "xxxxxxxxxxx"
})
member_role = fridge.get("roles/member")
$fridge = new \FridgeApi\Client("sk_xxxxxxxxxxx", "xxxxxxxxxxx");
$fridge->get("roles/member?site=1");
Example Response:
{
"id": 7,
"site_id": 1,
"name": "Member",
"slug": "member",
"date_created": "2015-01-01 01:00:00",
"date_updated": "2015-01-01 01:00:00",
"display_order": 0,
"options": {},
"parts": [
{
"name": "photo",
"label": "Photo",
"type": "image"
}
],
"admin_access": false,
"permissions": {}
}
Retrieve the details of an existing user role. You must supply the unique site id and user role id or slug.
siteREQUIRED | The id of the site where the user role belongs. |
:identifierREQUIRED | The id or slug of the user role. |
GET https://api.fridgecms.com/v1/roles/:identifier
$ curl https://api.fridgecms.com/v1/roles/member \
-X PUT \
-d site=1 \
-d permissions={"content_type":["read"],"content":["read","create","update","delete"]}
const Fridge = require('fridge')
const fridge = new Fridge({
client_id: 'sk_xxxxxxxxxxx',
client_secret: 'xxxxxxxxxxxx'
})
fridge.put('roles/member', {
'site': 1,
'permissions': {
'content_type': [
'read'
],
'content': [
'read',
'create',
'update',
'delete'
]
}
})
require 'fridge_api'
fridge = FridgeApi.client({
:client_id => "sk_xxxxxxxxxxx"
:client_secret => "xxxxxxxxxxx"
})
fridge.put("roles/member", {
:permissions => {
:content_type => [:read],
:content => [:read, :create, :update, :delete]
}
})
$fridge = new \FridgeApi\Client("sk_xxxxxxxxxxx", "xxxxxxxxxxx");
$fridge->put("roles/member", array(
"site" => 1,
"permissions" => array(
"content_type" => array("read"),
"content" => array("read", "create", "update", "delete")
)
));
Example Response:
{
"id": 7,
"site_id": 1,
"name": "Member",
"slug": "member",
"date_created": "2015-01-01 01:00:00",
"date_updated": "2015-01-01 01:00:00",
"display_order": 0,
"options": {},
"parts": [
{
"name": "photo",
"label": "Photo",
"type": "image"
}
],
"admin_access": false,
"permissions": {}
}
Updates the specified user role by setting the values of the parameters passed.
siteREQUIRED | The id of the site where the user role will be created. |
name | The name of the user role. |
display_order | A 0-based number specifying the default order in which the content type is listed. |
options | An object of key/value pair options. |
partsREQUIRED | An array of part definition objects. |
admin_accessAdmins only | Control if this role has access to the Fridge dashboard. |
permissionsAdmins only | An object of role-based permissions |
PUT https://api.fridgecms.com/v1/roles/:identifier
$ curl https://api.fridgecms.com/v1/roles/member \
-X DELETE \
-d site=1
const Fridge = require('fridge')
const fridge = new Fridge({
client_id: 'sk_xxxxxxxxxxx',
client_secret: 'xxxxxxxxxxxx'
})
fridge.delete('roles/member', {
'site': 1
})
require 'fridge_api'
fridge = FridgeApi.client({
:client_id => "sk_xxxxxxxxxxx"
:client_secret => "xxxxxxxxxxx"
})
fridge.delete("roles/member")
$fridge = new \FridgeApi\Client("sk_xxxxxxxxxxx", "xxxxxxxxxxx");
$fridge->delete("roles/member", array(
"site" => 1
));
Example Response:
{
"status": 200
}
Permanently deletes a user role. It cannot be undone.
siteREQUIRED | The id of the site where the user role belongs. |
:identifierREQUIRED | The id or slug of the user role. |
DELETE https://api.fridgecms.com/v1/roles/:identifier
$ curl https://api.fridgecms.com/v1/roles?site=1
const Fridge = require('fridge')
const fridge = new Fridge({
client_id: 'sk_xxxxxxxxxxx',
client_secret: 'xxxxxxxxxxxx'
})
fridge.get('roles?site=1')
require 'fridge_api'
fridge = FridgeApi.client({
:client_id => "sk_xxxxxxxxxxx"
:client_secret => "xxxxxxxxxxx"
})
user_roles = fridge.get("roles")
$fridge = new \FridgeApi\Client("sk_xxxxxxxxxxx", "xxxxxxxxxxx");
$fridge->get("roles?site=1");
Example Response:
[
{
"id": 7,
"site_id": 1,
"name": "Member",
"slug": "member",
"date_created": "2015-01-01 01:00:00",
"date_updated": "2015-01-01 01:00:00",
"display_order": 0,
"options": {},
"parts": [
{
"name": "photo",
"label": "Photo",
"type": "image"
}
],
"admin_access": false,
"permissions": {}
}
]
Retrieve a list of user roles.
siteREQUIRED | The id of the site. |
GET https://api.fridgecms.com/v1/roles
$ curl https://api.fridgecms.com/v1/users/role/member \
-X POST \
-d site=1 \
-d email="[email protected]" \
-d active=1
const Fridge = require('fridge')
const fridge = new Fridge({
client_id: 'sk_xxxxxxxxxxx',
client_secret: 'xxxxxxxxxxxx'
})
fridge.post('users/role/member', {
'site': 1,
'email': '[email protected]',
'active': 1
})
require 'fridge_api'
fridge = FridgeApi.client({
:client_id => "sk_xxxxxxxxxxx"
:client_secret => "xxxxxxxxxxx"
})
user = fridge.post("users/role/member", {
:email => "[email protected]",
:active => true
})
$fridge = new \FridgeApi\Client("sk_xxxxxxxxxxx", "xxxxxxxxxxx");
$fridge->post("users/role/member", array(
"site" => 1,
"email" => "[email protected]",
"active" => 1
));
Example Response:
{
"id": 21,
"date_created": "2015-02-01 01:00:00",
"date_updated": "2015-02-01 01:00:00",
"active": true,
"content": [],
"email": "[email protected]"
}
Creates a new user.
siteREQUIRED | The id of the site where the user will be created. |
:identifierREQUIRED | The id or slug of the user role used to create the user. |
activedefault is true | The id of the site where the user will be created. |
emailREQUIREDunique | Email address. |
passwordREQUIRED | Password. |
contentREQUIRED | An array or hash of content values paired to part identifiers |
If you create a new user that has the same email as another user from a different site, Fridge will allow that existing user access to the specified site id rather than creating a new user.
POST https://api.fridgecms.com/v1/users/role/:identifier
$ curl https://api.fridgecms.com/v1/users/21?site=1
const Fridge = require('fridge')
const fridge = new Fridge({
client_id: 'sk_xxxxxxxxxxx',
client_secret: 'xxxxxxxxxxxx'
})
fridge.get('users/21?site=1')
require 'fridge_api'
fridge = FridgeApi.client({
:client_id => "sk_xxxxxxxxxxx"
:client_secret => "xxxxxxxxxxx"
})
user = fridge.get("users/21")
$fridge = new \FridgeApi\Client("sk_xxxxxxxxxxx", "xxxxxxxxxxx");
$fridge->get("users/21?site=1");
Example Response:
{
"id": 21,
"date_created": "2015-02-01 01:00:00",
"date_updated": "2015-02-01 01:00:00",
"active": true,
"content": [],
"email": "[email protected]"
}
Retrieve the details of an existing user. You must supply the unique site id and user id.
siteREQUIRED | The id of the site where the user belongs. |
:idREQUIRED | The id of the user. |
GET https://api.fridgecms.com/v1/users/:identifier
$ curl https://api.fridgecms.com/v1/users/21 \
-X PUT \
-d site=1 \
-d active=0
const Fridge = require('fridge')
const fridge = new Fridge({
client_id: 'sk_xxxxxxxxxxx',
client_secret: 'xxxxxxxxxxxx'
})
fridge.put('users/21', {
'site': 1,
'active': 0
})
require 'fridge_api'
fridge = FridgeApi.client({
:client_id => "sk_xxxxxxxxxxx"
:client_secret => "xxxxxxxxxxx"
})
user = fridge.put("users/21", {
:active => false
})
$fridge = new \FridgeApi\Client("sk_xxxxxxxxxxx", "xxxxxxxxxxx");
$fridge->put("users/21", array(
"site" => 1,
"active" => 0
));
Example Response:
{
"id": 21,
"date_created": "2015-02-01 01:00:00",
"date_updated": "2015-02-01 01:00:00",
"active": true,
"content": [],
"email": "[email protected]"
}
Updates the specified user by setting the values of the parameters passed.
siteREQUIRED | The id of the site where the user belongs. |
:idREQUIRED | The id of the user. |
activedefault is true | Boolean which indicates if the user is active or not. |
emailREQUIREDunique | Email address. |
passwordREQUIREDAdmins only | Supplying a passowrd will change the password of the user. |
contentREQUIRED | An array or hash of content values paired to part identifiers |
PUT https://api.fridgecms.com/v1/users/:id
$ curl https://api.fridgecms.com/v1/users/21 \
-X DELETE \
-d site=1
const Fridge = require('fridge')
const fridge = new Fridge({
client_id: 'sk_xxxxxxxxxxx',
client_secret: 'xxxxxxxxxxxx'
})
fridge.delete('users/21', {
'site': 1
})
require 'fridge_api'
fridge = FridgeApi.client({
:client_id => "sk_xxxxxxxxxxx"
:client_secret => "xxxxxxxxxxx"
})
fridge.delete("users/21")
$fridge = new \FridgeApi\Client("sk_xxxxxxxxxxx", "xxxxxxxxxxx");
$fridge->delete("users/21", array(
"site" => 1
));
Example Response:
{
"status": 200
}
Permanently deletes a user. It cannot be undone.
siteREQUIRED | The id of the site where the user belongs. |
:idREQUIRED | The id of the user. |
activedefault is true | Boolean which indicates if the user is active or not. |
emailREQUIREDunique | Email address. |
passwordREQUIREDAdmins only | Supplying a passowrd will change the password of the user. |
contentREQUIRED | An array or hash of content values paired to part identifiers |
DELETE https://api.fridgecms.com/v1/user/:id
$ curl https://api.fridgecms.com/v1/users?role=member&site=1
const Fridge = require('fridge')
const fridge = new Fridge({
client_id: 'sk_xxxxxxxxxxx',
client_secret: 'xxxxxxxxxxxx'
})
fridge.get('users?role=member&site=1')
require 'fridge_api'
fridge = FridgeApi.client({
:client_id => "sk_xxxxxxxxxxx"
:client_secret => "xxxxxxxxxxx"
})
members = fridge.get("users/role/member")
$fridge = new \FridgeApi\Client("sk_xxxxxxxxxxx", "xxxxxxxxxxx");
$fridge->get("users?role=member&site=1");
Example Response:
[
{
"id": 21,
"date_created": "2015-02-01 01:00:00",
"date_updated": "2015-02-01 01:00:00",
"active": true,
"content": [],
"email": "[email protected]"
}
]
Retrieve a list of users.
siteREQUIRED | The id of the site. |
role | The id or slug of a user role to filter by. |
active | true or false or all . Filters content by active, inactive, or both. |
limit | A number which limits the amount of content retrieved. |
offset | A number which offsets the start of content retrieved. |
sort_methoddefault is date_created or the sort method of the user role | Specify how users are sorted. Options are date_created , manual , or any valid part name. |
sort_order | Specify the direction of the sort. asc or desc |
{part_name} | Any part name/part value pair to filter by. |
GET https://api.fridgecms.com/v1/users