REST API Documentation
/cms/records/{database_id}
Create a record
For requests using an OAuth Access Token for a particular member, any parameters the user doesn't have permission to use are ignored (for example, locked will only be honoured if the authenticated user has permission to lock records).
Parameters
Name | Type | Description |
---|---|---|
Required
category
|
int | The ID number of the category the record should be created in. If the database does not use categories, this is not required |
Required
author
|
int | The ID number of the member creating the record (0 for guest) Required for requests made using an API Key or the Client Credentials Grant Type. For requests using an OAuth Access Token for a particular member, that member will always be the author |
Required
fields
|
object | Field values. Keys should be the field ID, and the value should be the value. For fields of the Upload type, the type of the value must also be an object itself, with each key set as the filename and the value set as the raw file contents. For requests using an OAuth Access Token for a particular member, values will be sanatised where necessary. For requests made using an API Key or the Client Credentials Grant Type values will be saved unchanged. |
prefix
|
string | Prefix tag |
tags
|
string | Comma-separated list of tags (do not include prefix) |
date
|
datetime | The date/time that should be used for the record date. If not provided, will use the current date/time. Ignored for requests using an OAuth Access Token for a particular member. |
ip_address
|
string | The IP address that should be stored for the record. If not provided, will use the IP address from the API request. Ignored for requests using an OAuth Access Token for a particular member. |
locked
|
int | 1/0 indicating if the record should be locked |
hidden
|
int | 0 = unhidden; 1 = hidden, pending moderator approval; -1 = hidden (as if hidden by a moderator) |
pinned
|
int | 1/0 indicating if the record should be pinned |
featured
|
int | 1/0 indicating if the record should be featured |
anonymous
|
bool | If 1, the item will be posted anonymously. |
image
|
object | An object with two properties to use as the record image. 'name' for the filename, and 'contents' for the image contents, Base64 Encoded. |
Exceptions
Code | Message | Description |
---|---|---|
2T306/4 |
INVALID_DATABASE |
The database ID does not exist |
1T306/5 |
NO_CATEGORY |
The category ID does not exist |
1T306/6 |
NO_AUTHOR |
The author ID does not exist |
2T306/G |
NO_PERMISSION |
The authorized user does not have permission to create a record in that category |
1T306/D |
TITLE_CONTENT_REQUIRED |
No title or content fields were supplied |
1S306/E |
UPLOAD_FIELD_NOT_OBJECT |
Field of type Upload was supplied without being set as an object |
1T306/F |
UPLOAD_FIELD_NO_FILES |
Field of type Upload was supplied without any files attached |
1T306/G |
UPLOAD_FIELD_MULTIPLE_NOT_ALLOWED |
Field of type Upload and a maximum of 1 file was supplied with multiple files |
1T306/H |
UPLOAD_FIELD_IMAGE_NOT_SUPPORTED |
Field of type Upload was supplied with an image was of an unsupported extension |
1T306/I |
UPLOAD_FIELD_IMAGES_ONLY |
Field of type Upload set to be image only was supplied with a non-image attachment |
1T306/J |
UPLOAD_FIELD_EXTENSION_NOT_ALLOWED |
Field of type Upload was supplied with one or more attachments of a non-supported file extension |
Response
Name | Type | Description |
---|---|---|
id
|
int | ID number |
title
|
string | Title |
category
|
categories object | Category |
fields
|
object | Field values |
author
|
member object | The member that created the event |
date
|
datetime | When the record was created |
description
|
string | Event description |
comments
|
int | Number of comments |
reviews
|
int | Number of reviews |
views
|
int | Number of posts |
prefix
|
string | The prefix tag, if there is one |
tags
|
array of strings | The tags |
locked
|
bool | Event is locked |
hidden
|
bool | Event is hidden |
pinned
|
bool | Event is pinned |
featured
|
bool | Event is featured |
url
|
string|NULL | URL, or NULL if the database has not been embedded onto a page |
rating
|
float | Average Rating |
image
|
string | Record Image |
topic
|
topic object | The topic |
categories
object
Name | Type | Description |
---|---|---|
id
|
int | ID number |
name
|
string | Name |
url
|
string | URL |
class
|
string | Node class |
parentId
|
int|null | Parent Node ID |
permissions
|
object|null | Node permissions |
member
object
Name | Type | Description |
---|---|---|
id
|
int | ID number |
name
|
string | Username |
title
|
string | Member title |
timezone
|
string | Member timezone |
formattedName
|
string | Username with group formatting |
primaryGroup
|
group object | Primary group |
secondaryGroups
|
array of group objects | Secondary groups |
email
|
string | Email address |
joined
|
datetime | Registration date |
registrationIpAddress
|
string | IP address when registered |
warningPoints
|
int | Number of active warning points |
reputationPoints
|
int | Number of reputation points |
photoUrl
|
string | URL to photo (which will be the site's default if they haven't set one) |
photoUrlIsDefault
|
bool | Indicates if the value of photoUrl is the site's default |
coverPhotoUrl
|
string | URL to profile cover photo (will be blank if there isn't one) |
profileUrl
|
string|null | URL to profile |
validating
|
bool | Whether or not the validating flag is set on the member account |
posts
|
int | Number of content item submissions member has made |
lastActivity
|
datetime|null | Last activity date on the site. |
lastVisit
|
datetime|null | Last distinct visit date on the site. |
lastPost
|
datetime|null | Latest content submission date. |
profileViews
|
int | Number of times member's profile has been viewed |
birthday
|
string | Member birthday in MM/DD/YYYY format (or MM/DD format if no year has been supplied). |
customFields
|
array of fieldgroup objects | Custom profile fields. For requests using an OAuth Access Token for a particular member, only fields the authorized user can view will be included |
rank
|
array of rank objects | Rank |
achievements_points
|
int | Points |
allowAdminEmails
|
bool | Whether or not this member wants to receive admin emails |
completed
|
bool | Whether or not the registration is completed |
group
object
Name | Type | Description |
---|---|---|
id
|
int | ID number |
name
|
string | Name |
formattedName
|
string | Name with formatting |
rank
object
Name | Type | Description |
---|---|---|
id
|
int | ID number |
name
|
string | Name |
url
|
string | Path to the rank icon |
points
|
int | Points |
topic
object
Name | Type | Description |
---|---|---|
id
|
int | ID number |
title
|
string | Title |
forum
|
forum object | Forum |
posts
|
int | Number of posts |
views
|
int | Number of views |
prefix
|
string | The prefix tag, if there is one |
tags
|
array of strings | The tags |
firstPost
|
post object | The first post in the topic |
lastPost
|
post object | The last post in the topic |
bestAnswer
|
post object | The best answer, if this is a question and there is one |
locked
|
bool | Topic is locked |
hidden
|
bool | Topic is hidden |
pinned
|
bool | Topic is pinned |
featured
|
bool | Topic is featured |
archived
|
bool | Topic is archived |
poll
|
poll object | Poll data, if there is one |
url
|
string | URL |
rating
|
float | Average Rating |
forum
object
Name | Type | Description |
---|---|---|
id
|
int | ID number |
name
|
string | Forum name |
path
|
string | Forum name including parents (e.g. "Example Category > Example Forum") |
type
|
string | The type of forum: "discussions", "questions", "category", or "redirect" |
topics
|
int | Number of topics in forum |
url
|
string | URL |
parentId
|
int|null | Parent Node ID |
permissions
|
object|null | Node permissions |
post
object
Name | Type | Description |
---|---|---|
id
|
int | ID number |
item_id
|
int | The ID number of the item this belongs to |
author
|
member object | Author |
date
|
datetime | Date |
content
|
string | The content |
hidden
|
bool | Is hidden? |
url
|
string | URL to content |
reactions
|
array | Array of reactions given, array key is member_id of reaction giver ([member_id => [ title, id, value, icon ]]) |
poll
object
Name | Type | Description |
---|---|---|
id
|
int | ID number |
title
|
string | Title |
startDate
|
datetime | Start Date |
closed
|
bool | Closed |
closedDate
|
datetime | Closed Date |
public
|
bool | Public poll |
votes
|
int | Number of votes |
questions
|
array of question objects | The questions |