-
Notifications
You must be signed in to change notification settings - Fork 0
Communityq content API version 2
The content API is a REST interface. It's old now, written 5+ years ago, is a little crude, and needs to be upgraded to our latest standards (JWT auth + SSL)... but it gets the job done.
- All requests should be POSTs
- URL is
api.communityq.com
- All requests must at least include the following parameters
-
account
=> name of client folder -
key
=>IAJ8a3ho8S$Ehno7S$HN*tDgtd
(hard-coded) -
action
=> name of action
-
- Output is JSON array:
-
status
=>ERROR
orOK
-
message
=> Returned ifstatus
=error
-
result
=> JSON array of action result ifstatus
=OK
-
-
Content.get => retrieve an item
- You can either fetch specific items:
-
id=12345
=> get a single -
ids=12,34,56
=> get multiple items
-
- Or search for items (I can clarify any of these params):
content_source
content_class
sub_type
user_id
list_type
most_viewed_timespan
most_commented_timespan
print_issue
town_list
category_list
search_filter
search_filter_mode
fielded_data[field]
story_access
date_start
date_end
where_extras
additional_columns
event_date_start
event_date_end
event_mode
event_span
order_by
order_sort
limit
get_all
page_size
page_current
- You can either fetch specific items:
-
Content.create => Make a new, blank item
-
type
defaults tostories
-
-
Content.put => Write an update to an item
-
id
orguid
(aka foreign key) is required -
asset
=> JSON key/value object of fields for the main content asset. Database schema is included in this wiki. -
media
=> JSON array of category assignments. Use one of the following:``` { clear: true, // Erases all add: [ {asset: 12345, caption: 'my caption', credit: 'joe smith'}, {asset: 12345, caption: 'my caption', credit: 'joe smith'} ], // Adds to existing. remove: (same aray format as add), // Remove from existing reset: (same aray format as add), // Reset to just this list } ```
-
categories
=> JSON array of category assignments. Use one of the following:``` { clear: true, // Erases all category associations add: [1,2,'sports'], // Adds to existing. Use ID or slug remove: [1,2,'sports'], // Remove from existing reset: [1,2,'sports'], // Reset to just this list } ```
-
subsites
=> JSON array of subssite assignments. Use one of the following:``` { clear: true, // Erases all associations add: [1,2,'The daily banner'], // Adds to existing. Use ID or name remove: [1,2], // Remove from existing reset: [1,2], // Reset to just this list } ```
-
-
Users.get
- You can either fetch specific items:
-
id=12345
=> get a single -
ids=12,34,56
=> get multiple items
-
- Or search for items (I can clarify any of these params):
list_type
photo_only
search_filter
search_filter_mode
exclude_staff
staff_only
where_extras
town_list
get_all
limit
page_size
page_current
order_by
order_sort
submission_count
online_now
tag_filter
- You can either fetch specific items:
-
Users.create => Make a new, blank record. No parameters.
-
Users.put
-
id
,email
, orusername
is required -
asset
=> JSON key/value object of fields for the main content asset. Database schema is included in this wiki.
-
-
Categories.get => Get a category or tree of categories
- Pass in an
id
oridentifier
(slug) to get a specific category - Pass in nothing to get the whole tree
- Pass in an
-
Categories.create => Make a new, blank record.
-
parent
=> ID of parent category
-
-
Categories.put
- Either
id
oridentifier
is required -
asset
=> JSON key/value object of fields for the main content asset. Database schema is included in this wiki.
- Either
-
Categories.getOrCreate
- Pass in
title
of category - It will return a full category asset from the DB
- Pass in
-
Media.get
-
id
orfile
is required
-
-
Media.create
-
type
can bephoto
(defaults to this if blank),video
, orfile
-
-
Media.put
-
id
required -
file
=> binary multipart file data for updating the physical file -
asset
=> JSON key/value object of fields for the main content asset. Database schema is included in this wiki.
-
-
Media.post
- This endpoint will take the first file found in the post data, import it, and return the asset information.
- The one requirement is that a file needs to be present.
-
asset
=> Pass this in as JSON key/value object to update the content asset with once imported.
-
Config.get => No params, returns site config variables
-
Dsn.get => No params, returns database connection information