canvases.sections.lookup
method
We're still building and not all features are available quite yet. Enjoy this peek into the future!
Not ready for the future? Return to the past at api.slack.com.
Usage info
This method is used to identify sections within a canvas.
Those identifiers may then be used to edit the section or apply edits relative to that section. Refer to the canvases.edit
method for more details.
Different criteria
may be used in combination to narrow down the targeted section. Sections may be identified by section_type
, which can be any of the following:
h1
h2
h3
any_header
For instance, using "section_types": ["h1"]
in the criteria
argument will search for all h1
headings. Alternatively, using any_header
will return the section IDs of any type of heading in the canvas. This may make more sense when used in combination with text criteria.
Sections may also be identified by the text they contain by using the contains_text
property. Referencing the example below, this set of criteria will return the section IDs of any heading that is a h1
or h2
style and contains the words "Grocery List".
{
"canvas_id": "F0166DCSTS7",
"criteria": {
"section_types": ["h1", "h2"],
"contains_text": "Grocery List"
}
}
Keep in mind, other types of sections exist that are not currently able to be used as a type to filter on. You may discover these when using a query with no section type provided.