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

# Get Media by ID

> Retrieves the media file content associated with a specific media ID.

Retrieves the media file content associated with a specific media ID. This endpoint redirects to or serves the actual file content, allowing direct browser access.


## OpenAPI

````yaml GET /api/pub/wa/media/url/{mediaId}
openapi: 3.1.0
info:
  title: AdsEra REST API
  description: >-
    Welcome to the AdsEra REST API. Use our API to integrate powerful,
    multi-channel communication (Email and WhatsApp) directly into your
    applications. Automate transactional messages, trigger marketing campaigns,
    manage your audience, and track performance programmatically.
  contact:
    name: Shubham
    email: shubham@adsera.in
  version: 1.0.0
servers:
  - url: https://app.adsera.in
    description: Production Server
security:
  - AppIdAuth: []
    AppSecretAuth: []
paths:
  /api/pub/wa/media/url/{mediaId}:
    get:
      tags:
        - Media
      summary: Get Media by ID
      description: Retrieves the media file content associated with a specific media ID.
      parameters:
        - name: mediaId
          in: path
          required: true
          description: The ID of the media to retrieve.
          schema:
            type: string
      responses:
        '200':
          description: The media file content.
          content:
            '*/*':
              schema:
                type: string
                format: binary
        '400':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - {}
components:
  responses:
    BadRequest:
      description: >-
        Bad Request. A required field is missing or an item is in an invalid
        state.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            MissingTemplate:
              value:
                status: 400
                success: false
                error: Template id not provided!
            TemplateNotApproved:
              value:
                status: 400
                success: false
                error: Template is not approved!
            WabaNotConnected:
              value:
                status: 400
                success: false
                error: WhatsApp Account Not Connected or Exist!
    InternalServerError:
      description: Internal Server Error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  schemas:
    ErrorResponse:
      type: object
      properties:
        status:
          type: integer
          example: 500
        success:
          type: boolean
          example: false
        error:
          type: string
          example: Internal Server Error!
  securitySchemes:
    AppIdAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Your application's unique ID.
    AppSecretAuth:
      type: apiKey
      in: header
      name: x-api-secret
      description: Your application's secret key.

````