Fields¶
The following fields of snippets have a value automatically generated for them and hence clients are not supposed to explicitly provide them:
The rest of the fields are optional, except for content
:
In more detail:
-
id
¶ - Type
number
- Read only
yes
The snippet’s primary key in the database.
-
content
¶ - Type
string
- Required
yes
The source code of the snippet.
-
language
¶ - Type
string
The programming language of the snippet. Must be a valid Pygments lexer name.
-
style
¶ - Type
string
The style the snippet should be highlighted with. Must be a valid Pygments style name.
-
line_numbers
¶ - Type
boolean
- Default
Whether line numbers should be shown in the snippet’s highlight view.
-
embed_title
¶ - Type
boolean
- Default
Whether the title of the snippet should be included in its full highlight view.
-
private
¶ - Type
boolean
- Default
Whether the snippet should be only viewable by its owner and staff users.
-
created
¶ - Type
string
- Read only
yes
The datetime of the snippet’s creation.
-
updated
¶ - Type
string
- Read only
yes
The datetime of the snippet’s last modification.
-
owner
¶ - Type
number / null
- Read only
yes
The primary key in the database of the user who created the snippet. If that user was unauthenticated, this field is null.