api:favorite groups
Table of Contents
The following includes the details of how to interface with favorite groups records through the API.
Record field format
| Name | Type | Details |
|---|---|---|
id | integer | >0 |
name | string | |
creator_id | integer | >0 |
post_ids | array | integers > 0 |
is_public | boolean | |
created_at | timestamp | |
updated_at | timestamp |
Associated attributes
| Name | Type | Availability | Number | Details |
|---|---|---|---|---|
creator | user | required | single |
Nomenclature
- Plural form: "favorite_groups"
- Used in the URL pathname
- Singular form: "favorite_group"
- Used for write parameters (Help:API Write Requests)
- Versions: None
Actions
Index
| HTTP Method | GET |
| Base URL | /favorite_groups.json |
| Type | read request |
| Description | The default order is ID descending. |
Search attributes
All of the following are standard attributes with all of their available formats and qualifiers.
- Number syntax
idcreated_atupdated_at- Text syntax
name- User syntax
creator- Array syntax
post_ids- Boolean syntax
is_public
Special search parameters
name_contains- Normalized case-insensitive wildcard searching on the name text field.order- Sets the order of the results.name- Alphabetic order by name, then ID descending.created_at- Orders by creation time descending.updated_at- Orders by update time descending, then ID descending.post_count- Orders by post count, then ID descending.
Show
| HTTP Method | GET |
| Base URL | /favorite_groups/$id.json |
| Type | read request |
| Description | $id is the favorite group ID. |
Create
| HTTP Method | POST |
| Base URL | /favorite_groups.json |
| Type | write request |
| Description |
Create parameters
- Required:
name- Optional:
post_ids- Uses URL array parameter format.post_ids_string- Space delimited list of post IDs.is_public- Only Gold+ users can set this tofalse.
Update
| HTTP Method | PUT/PATCH |
| Base URL | /favorite_groups/$id.json |
| Type | write request |
| Description | $id is the favorite group ID. |
Update parameters
Accepts the same parameters as the create favorite group action. All parameters are optional.
Add post
| HTTP Method | PUT |
| Base URL | /favorite_groups/$id/add_post.json |
| Type | write request |
| Description | $id is the favorite group ID. |
Add post parameters
- Required:
post_id- The post ID to add to the favorite group.
Remove post
| HTTP Method | PUT |
| Base URL | /favorite_groups/$id/remove_post.json |
| Type | write request |
| Description | $id is the favorite group ID. |
Remove post parameters
- Required:
post_id- The post ID to remove from the favorite group.
Destroy
| HTTP Method | DELETE |
| Base URL | /favorite_groups/$id/destroy.json |
| Type | write request |
| Description | $id is the favorite group ID. |
Note: Favorite group records are destroyed rather than deleted and cannot be viewed or retrieved later.
