---
title: "Get a Snippet"
url: "https://nov18-dev.movespot.fyi/apis/portal-2/versions/891fea74-0458-4c01-8657-e3e36ffacc99/operations/get-portal-snippet-by-name"
---

> Full API specification: https://nov18-dev.movespot.fyi/apis/portal-2/versions/891fea74-0458-4c01-8657-e3e36ffacc99.md

# Get a Snippet

`GET` `/api/v3/snippets/{snippetName}`

Operation ID: `get-portal-snippet-by-name`

Returns a single snippet for the portal. Each snippet has a name, title, and content. Public snippets will be returned for non-authenticated users, while both private and public snippets will be returned for authenticated users.

## Path parameters

- `snippetName` (string, required) - Targeted snippet, url-encoded. Must not start with /.

## Responses

- `200` - A single portal snippet
- `404` - Not Found

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: Portal
  version: 3.3.1
paths:
  /api/v3/snippets/{snippetName}:
    get:
      operationId: get-portal-snippet-by-name
      summary: Get a Snippet
      description: Returns a single snippet for the portal. Each snippet has a name,
        title, and content. Public snippets will be returned for
        non-authenticated users, while both private and public snippets will be
        returned for authenticated users.
      parameters:
        - $ref: "#/components/parameters/snippetName"
      responses:
        "200":
          $ref: "#/components/responses/GetPortalSnippetResponse"
        "404":
          $ref: "#/components/responses/NotFound"
      security:
        - portalAccessToken: []
        - {}
      tags:
        - Content
security:
  - portalAccessToken: []
  - {}
components:
  parameters:
    snippetName:
      name: snippetName
      in: path
      required: true
      description: Targeted snippet, url-encoded. Must not start with /.
      example: mysnippet
      schema:
        type: string
  responses:
    GetPortalSnippetResponse:
      description: A single portal snippet
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/PortalSnippet"
          examples:
            PortalPageResponseExample1:
              value:
                id: 582b9327-3eba-4bfe-9438-6066840dbbca
                title: Home
                name: snip1
                content: "# Welcome to the Developer Portal"
                visibility: public
                created_at: 2021-09-01T00:00:00Z
                updated_at: 2021-09-01T00:00:00Z
    NotFound:
      description: Not Found
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/NotFoundError"
          examples:
            NotFoundExample:
              $ref: "#/components/examples/NotFoundExample"
  schemas:
    PortalSnippet:
      description: A single snippet for the portal
      type: object
      properties:
        id:
          $ref: "#/components/schemas/PageId"
        title:
          $ref: "#/components/schemas/SnippetTitle"
        name:
          $ref: "#/components/schemas/SnippetName"
        content:
          $ref: "#/components/schemas/SnippetContent"
        visibility:
          $ref: "#/components/schemas/Visibility"
        description:
          $ref: "#/components/schemas/Description"
        created_at:
          $ref: "#/components/schemas/CreatedAt"
        updated_at:
          $ref: "#/components/schemas/UpdatedAt"
      additionalProperties: false
      required:
        - id
        - title
        - name
        - content
        - visibility
        - created_at
        - updated_at
      title: PortalSnippet
    NotFoundError:
      allOf:
        - $ref: "#/components/schemas/BaseError"
        - type: object
          properties:
            status:
              example: 404
            title:
              example: Not Found
            type:
              example: https://httpstatuses.com/404
            instance:
              example: kong:trace:1234567890
            detail:
              example: Not found
    PageId:
      description: The unique identifier of the page
      type: string
      format: uuid
      example: 582b9327-3eba-4bfe-9438-6066840dbbca
      title: PageId
    SnippetTitle:
      description: The title of the snippet
      type: string
      example: My Snippet
      title: SnippetTitle
    SnippetName:
      description: The name of the snippet (no leading slash)
      type: string
      example: my-snippet
      title: SnippetName
    SnippetContent:
      description: The renderable markdown content of the snippet
      type: string
      example: "# Welcome to the Developer Portal"
      title: SnippetContent
    Visibility:
      description: Whether the page or snippet is public or private. Private pages and
        snippets are only accessible to authenticated users.
      type: string
      example: public
      enum:
        - public
        - private
      title: Resource Public Visibility
    Description:
      type: string
      example: A custom page about developer portals
      title: ResourceDescription
    CreatedAt:
      description: An ISO-8601 timestamp representation of entity creation date.
      type: string
      format: date-time
      example: 2022-11-04T20:10:06.927Z
      readOnly: true
    UpdatedAt:
      description: An ISO-8601 timestamp representation of entity update date.
      type: string
      format: date-time
      example: 2022-11-04T20:10:06.927Z
      readOnly: true
    BaseError:
      description: standard error
      type: object
      properties:
        status:
          description: >
            The HTTP status code of the error. Useful when passing the response

            body to child properties in a frontend UI. Must be returned as an
            integer.
          type: integer
          readOnly: true
        title:
          description: |
            A short, human-readable summary of the problem. It should not
            change between occurences of a problem, except for localization.
            Should be provided as "Sentence case" for direct use in the UI.
          type: string
          readOnly: true
        type:
          description: The error type.
          type: string
          readOnly: true
        instance:
          description: |
            Used to return the correlation ID back to the user, in the format
            kong:trace:<correlation_id>. This helps us find the relevant logs
            when a customer reports an issue.
          type: string
          readOnly: true
        detail:
          description: >
            A human readable explanation specific to this occurence of the
            problem.

            This field may contain request/entity data to help the user
            understand

            what went wrong. Enclose variable values in square brackets. Should
            be

            provided as "Sentence case" for direct use in the UI.
          type: string
          readOnly: true
      required:
        - status
        - title
        - instance
        - detail
      title: Error
  examples:
    NotFoundExample:
      value:
        status: 404
        title: Not Found
        instance: kong:trace:6816496025408232265
        detail: Not Found
  securitySchemes:
    portalAccessToken:
      type: apiKey
      in: cookie
      name: portalaccesstoken
      description: >
        The Developer portal cookie is meant to be used by the Developer API to
        authenticate with.
```
