api:favorite groups
Table of Contents
- 01. Record field format
- 02. Associated attributes
- 03. Index
- 04. Show
- 05. Create
- 06. Update
- 07. Add post
- 08. Remove post
- 09. Destroy
- 10. See also
- 11. External links
This page has details for how to interact with favorite group records through the API.
01 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 |
02 Associated attributes
The following is the list of relations that can be included in the API results (see Help:Common URL parameters for more info):
| Name | Type | Availability | Number | Details |
|---|---|---|---|---|
creator | user | required | single |
03 Index
Returns multiple favorite group records.
| HTTP Method | GET |
| Base URL | /favorite_groups.json |
| Type | read request |
| Description | The default order is ID descending. |
Search attributes
Search parameters take the following format (see Help:Common URL parameters for more info):
search[FIELD]=VALUE
The following are the base fields along with their associated type. Check the syntax pages for all of the available variations.
- Number syntax
idcreated_atupdated_at- Text syntax
name- User syntax
creator- Array syntax
post_ids- Boolean syntax
is_public
Special search parameters
The following are additional search fields.
name_contains- Normalized case-insensitive wildcard searching on the name text field.
Search order
Using the search parameter order with one of the following values changes 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.
04 Show
Returns a single favorite group record.
| HTTP Method | GET |
| Base URL | /favorite_groups/$id.json |
| Type | read request |
| Description | $id is the favorite group ID. |
05 Create
Creates a single favorite group record.
| HTTP Method | POST |
| Base URL | /favorite_groups.json |
| Type | write request |
| Description |
Create parameters
Favorite group parameters take the following format (see Help:API Write Requests for more info):
favorite_group[FIELD]=VALUE
- 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.
06 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 create action. All parameters are optional.
07 Add post
Adds a single post to a favorite group.
| 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.
08 Remove post
Removes a single post from a favorite group.
| 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.
09 Destroy
Deletes a single favorite group record.
| HTTP Method | DELETE |
| Base URL | /favorite_groups/$id.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.
