-
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=>ERRORorOK -
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_sourcecontent_classsub_typeuser_idlist_typemost_viewed_timespanmost_commented_timespanprint_issuetown_listcategory_listsearch_filtersearch_filter_modefielded_data[field]story_accessdate_startdate_endwhere_extrasadditional_columnsevent_date_startevent_date_endevent_modeevent_spanorder_byorder_sortlimitget_allpage_sizepage_current
- You can either fetch specific items:
-
Content.create => Make a new, blank item
-
typedefaults tostories
-
-
Content.put => Write an update to an item
-
idorguid(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_typephoto_onlysearch_filtersearch_filter_modeexclude_staffstaff_onlywhere_extrastown_listget_alllimitpage_sizepage_currentorder_byorder_sortsubmission_countonline_nowtag_filter
- You can either fetch specific items:
-
Users.create => Make a new, blank record. No parameters.
-
Users.put
-
id,email, orusernameis 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
idoridentifier(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
idoridentifieris 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
titleof category - It will return a full category asset from the DB
- Pass in
-
Media.get
-
idorfileis required
-
-
Media.create
-
typecan bephoto(defaults to this if blank),video, orfile
-
-
Media.put
-
idrequired -
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