> ## Documentation Index
> Fetch the complete documentation index at: https://giftbit.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve link URLs

> Retrieves the URLs for a link-based order (shortlink or direct link). The URLs
are ready after a short delay following the successful response from `/campaign`
or `/direct_links`. We recommend polling every 5 minutes until the URLs are ready.

The response contains a `shortlinks` array for shortlink orders and a
`directlinks` array for direct link orders.




## OpenAPI

````yaml /api-reference/openapi.yaml get /links/{id}
openapi: 3.1.0
info:
  title: Giftbit API
  version: v1
  description: >
    Giftbit's REST API lets you automatically order rewards and send them to
    your

    recipients. Delivery can be handled either by links that integrate into
    another

    system's workflow, or by emails sent through the Giftbit system.


    Authenticate every request with a bearer token in the `Authorization`
    header.

    Only an HTTP `200` means success; all non-`200` responses share a common
    error body.
  contact:
    name: Giftbit Support
    email: testbed@giftbit.com
    url: https://www.giftbit.com/api-documentation
servers:
  - url: https://api-testbed.giftbit.com/papi/v1
    description: Testbed
  - url: https://api.giftbit.com/papi/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Ping
    description: Test your authentication and check the health of the Giftbit API.
  - name: Brands
    description: List reward brands and retrieve extended information about a single brand.
  - name: Regions
    description: List the regions used to filter brands and request Full Catalog rewards.
  - name: Email Orders
    description: Order one or more rewards delivered to recipients by Giftbit email.
  - name: Shortlink Orders
    description: Order branded shortlink rewards that include a customized landing page.
  - name: Direct Link Orders
    description: >-
      Order minimally branded direct link rewards returned immediately in the
      response.
  - name: Embedded Rewards
    description: >-
      Order a single in-app reward for immediate delivery in your app or
      website.
  - name: Funds
    description: Retrieve your account balance and top it up with a credit card payment.
  - name: Rewards
    description: List, retrieve, resend, and cancel individual rewards.
paths:
  /links/{id}:
    get:
      tags:
        - Shortlink Orders
      summary: Retrieve link URLs
      description: >
        Retrieves the URLs for a link-based order (shortlink or direct link).
        The URLs

        are ready after a short delay following the successful response from
        `/campaign`

        or `/direct_links`. We recommend polling every 5 minutes until the URLs
        are ready.


        The response contains a `shortlinks` array for shortlink orders and a

        `directlinks` array for direct link orders.
      operationId: retrieve-shortlink-urls
      parameters:
        - name: id
          in: path
          required: true
          description: The client provided id of the order.
          schema:
            type: string
      responses:
        '200':
          description: Links retrieved, or generation still in progress.
          content:
            application/json:
              schema:
                type: object
                properties:
                  info:
                    $ref: '#/components/schemas/Info'
                  shortlinks:
                    type: array
                    items:
                      type: object
                      properties:
                        number:
                          type: integer
                        shortlink:
                          type: string
                  directlinks:
                    type: array
                    items:
                      type: object
                      properties:
                        number:
                          type: integer
                        link:
                          type: string
                  number_of_results:
                    type: integer
                  limit:
                    type: integer
                  offset:
                    type: integer
                  total_count:
                    type: integer
              examples:
                inProgress:
                  summary: Generation in progress
                  value:
                    info:
                      code: INFO_LINKS_GENERATION_IN_PROGRESS
                      name: >-
                        Links have not yet completed generating; request again
                        in 5 minutes
                      message: >-
                        Link generation is not complete. Large orders will take
                        some time to process and may be held for manual review;
                        use the /campaign endpoint for more detail on your order
                shortlinksReady:
                  summary: Shortlinks ready
                  value:
                    info:
                      code: INFO_LINKS
                      name: Link information retrieved
                      message: Returned links for requested Campaign
                    shortlinks:
                      - number: 1
                        shortlink: http://gtbt.co/q5WmFXVjCAh
                    number_of_results: 1
                    limit: 50
                    offset: 0
                    total_count: 1
                directLinksReady:
                  summary: Direct links ready
                  value:
                    info:
                      code: INFO_LINKS
                      name: Link information retrieved
                      message: Returned links for requested Campaign
                    directlinks:
                      - link: >-
                          https://reward.giftbit.com/getReward/dl-59ec25692ca940358fcd51e91e3d1fdb
                        number: 1
                    number_of_results: 1
                    limit: 50
                    offset: 0
                    total_count: 1
components:
  schemas:
    Info:
      type: object
      description: Status information returned on successful requests.
      properties:
        code:
          type: string
          description: An enum-style status code for the request.
        name:
          type: string
          description: Human-readable status name.
        message:
          type: string
          description: Request-context-specific message.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Send your API token prefixed by `Bearer ` in the `Authorization` header.

````