api:notes
Table of Contents
- 01. Record field format
- 02. Associated attributes
- 03. Nomenclature
- 04. Index
- 05. Show
- 06. Create
- 07. Update
- 08. Delete
- 09. Revert
- 10. See also
- 10. External links
The following includes the details of how to interface with the note records through the API.
Record field format
¶
[table]
[thead]
[tr]
[th]Name[/th]
[th]Type[/th]
[th]Details[/th]
[/tr]
[/thead]
[tbody]
[tr]
[td]
id[/td][td]integer[/td]
[td]>0[/td]
[/tr]
[tr]
[td]
post_id[/td][td]integer[/td]
[td]>0[/td]
[/tr]
[tr]
[td]
body[/td][td]string[/td]
[td][/td]
[/tr]
[tr]
[td]
x[/td][td]integer[/td]
[td]>0[/td]
[/tr]
[tr]
[td]
y[/td][td]integer[/td]
[td]>0[/td]
[/tr]
[tr]
[td]
width[/td][td]integer[/td]
[td]>0[/td]
[/tr]
[tr]
[td]
height[/td][td]integer[/td]
[td]>0[/td]
[/tr]
[tr]
[td]
is_active[/td][td]boolean[/td]
[td][/td]
[/tr]
[tr]
[td]
version[/td][td]integer[/td]
[td]>0[/td]
[/tr]
[tr]
[td]
created_at[/td][td]timestamp[/td]
[td][/td]
[/tr]
[tr]
[td]
updated_at[/td][td]timestamp[/td]
[td][/td]
[/tr]
[/tbody]
[/table]
Associated attributes
¶
[table]
[thead]
[tr]
[th]Name[/th]
[th]Type[/th]
[th]Number[/th]
[th]Availability[/th]
[th]Details[/th]
[/tr]
[/thead]
[tbody]
[tr]
[td]
post[/td][td]post[/td]
[td]single[/td]
[td]required[/td]
[td][/td]
[/tr]
[/tbody]
[/table]
Nomenclature
¶
- Plural form: "notes"
- Singular form: "note"
- Versions: API:Note versions
Index
¶
[table]
[tbody]
[tr]
[td]HTTP Method[/td]
[td]GET[/td]
[/tr]
[tr]
[td]Base URL[/td]
[td]
/notes.json[/td][/tr]
[tr]
[td]Type[/td]
[td]read request[/td]
[/tr]
[tr]
[td]Description[/td]
[td]The default order is ID descending.[/td]
[/tr]
[/tbody]
[/table]
Search attributes
¶
All of the following are standard attributes with all of their available formats and qualifiers.
••id
••
x
••
y
••
width
••
height
••
version
••
created_at
••
updated_at
•• body
•• is_active
•• post
Special search parameters
¶
- Case-insensitive wildcard searching on the body text field.body_matches
Show
¶
[table]
[tbody]
[tr]
[td]HTTP Method[/td]
[td]GET[/td]
[/tr]
[tr]
[td]Base URL[/td]
[td]
/notes/$id.json[/td][/tr]
[tr]
[td]Type[/td]
[td]read request[/td]
[/tr]
[tr]
[td]Description[/td]
[td]
$id is the note ID.[/td][/tr]
[/tbody]
[/table]
Note: This does a redirect to the post with that note when using the HTML interface, specifically highlighting that note when it gets there.
Create
¶
[table]
[tbody]
[tr]
[td]HTTP Method[/td]
[td]POST[/td]
[/tr]
[tr]
[td]Base URL[/td]
[td]
/notes.json[/td][/tr]
[tr]
[td]Type[/td]
[td]write request[/td]
[/tr]
[/tbody]
[/table]
Create parameters
¶
- Required:
post_id - The post ID the note belongs to.
••
x - X coordinate of the note starting from the left of the image.
••
y - y coordinate of the note starting from the top of the image.
••
height
••
width
••
body
- Optional
is_active - Whether the note is active or not (i.e. deleted).
Note: The note box must fit within the full-size dimensions of the image.
Update
¶
[table]
[tbody]
[tr]
[td]HTTP Method[/td]
[td]PUT/PATCH[/td]
[/tr]
[tr]
[td]Base URL[/td]
[td]
/notes/$id.json[/td][/tr]
[tr]
[td]Type[/td]
[td]write request[/td]
[/tr]
[tr]
[td]Description[/td]
[td]
$id is the note ID.[/td][/tr]
[/tbody]
[/table]
Update parameters
¶
Accepts the "same parameters":[#dtext-create-parameters] as the "create note action":[#dtext-create], except for the post ID. All parameters are optional.
Delete
¶
[table]
[tbody]
[tr]
[td]HTTP Method[/td]
[td]DELETE[/td]
[/tr]
[tr]
[td]Base URL[/td]
[td]
/notes/$id.json[/td][/tr]
[tr]
[td]Type[/td]
[td]write request[/td]
[/tr]
[tr]
[td]Description[/td]
[td]
$id is the note ID.[/td][/tr]
[/tbody]
[/table]
Revert
¶
[table]
[tbody]
[tr]
[td]HTTP Method[/td]
[td]PUT[/td]
[/tr]
[tr]
[td]Base URL[/td]
[td]
/notes/$id/revert.json[/td][/tr]
[tr]
[td]Type[/td]
[td]write request[/td]
[/tr]
[tr]
[td]Description[/td]
[td]
$id is the note ID.[/td][/tr]
[/tbody]
[/table]
Revert parameters
¶
- Required:
See also
¶
External links
¶
[table]
[tbody]
[tr]
[td]Controller[/td]
[td]
[td][/td]
[/tr]
[tr]
[td]Model[/td]
[td]
[/tr]
[tr]
[td]Policy[/td]
[td]
[/tr]
[/tbody]
[/table]