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

# Get Media

> This API enables developers to receive media files encoded in the BASE64 format within the CommBox platform.<br>To retrieve all children and files of the object, use the Get Object API with the Query parameter -><b> includeChilds = true</b>.<br>Object’s children containing images will be listed with their file name and server location.<br><br>To convert the file into BASE64 format, add “?encoding=base64” to JSON request.<br><br><b>Note:</b> User must be authorized to access the brand and channel where the image is found.<br><br>Format:<br>GET https://api.commbox.io/media/brands/bumpyard/whatsapp/3-24/ce56dd94ce.jpeg<b>?encoding=base64</b>

## OpenAPI

````json GET /media/{resource_path}
{
  "openapi": "3.0.3",
  "info": {
    "title": "CommBox API",
    "x-logo": {
      "url": "https://www.commbox.io/logo/commbox_logo_large.png"
    },
    "version": "2.07",
    "termsOfService": "https://www.commbox.io/end-user-license-agreement-eula/",
    "contact": {
      "name": "commbox",
      "url": "https://www.commbox.io",
      "email": "contactus@commbox.io"
    }
  },
  "servers": [
    {
      "url": "https://api.commbox.io/",
      "description": "Production server"
    }
  ],
  "paths": {
    "/media/{resource_path}": {
      "get": {
        "tags": [
          "Media"
        ],
        "summary": "Get Media",
        "description": "This API enables developers to receive media files encoded in the BASE64 format within the CommBox platform.<br>To retrieve all children and files of the object, use the Get Object API with the Query parameter -><b> includeChilds = true</b>.<br>Object’s children containing images will be listed with their file name and server location.<br><br>To convert the file into BASE64 format, add “?encoding=base64” to JSON request.<br><br><b>Note:</b> User must be authorized to access the brand and channel where the image is found.<br><br>Format:<br>GET https://api.commbox.io/media/brands/bumpyard/whatsapp/3-24/ce56dd94ce.jpeg<b>?encoding=base64</b>",
        "operationId": "Get_Media_link",
        "parameters": [
          {
            "name": "resource_path",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/parameters/OBJECT_ID"
            },
            "description": "The media file location and name"
          },
          {
            "name": "encoding=base64",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/parameters/OBJECT_ID"
            },
            "description": "When there is no query param, default is binary file retrieval"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "200"
                    },
                    "description": {
                      "type": "string",
                      "example": "Operation successful"
                    },
                    "response_time": {
                      "type": "string",
                      "example": "2025-06-06T07:51:52.2581942Z"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "fileName": {
                          "type": "string",
                          "example": "dec23rn2_63bdec8e12.png"
                        },
                        "contentType": {
                          "type": "string",
                          "example": "image/png"
                        },
                        "data": {
                          "type": "string",
                          "description": " Base64 code of media file (partial)",
                          "example": "iVBORw0KGgoAAAANSUhEUgAAAgAAAACbCAYAAAAURiNTAAAABGdBTUEAALGPC/xhBQAANABJREFUeF7tnWd0VFee7b3mw1vvw1szveat1+/N9LRn2h7b7UDGYHew3W67nbrbsW0aG2Nsg4nC5JxzzjlIiChAQuSccxBBOeeEMhIZ2/udfYojF3KBBQjaqDZr/VbVPffEW6L2Pv9zbt2H8vLykJaWhvT0dGRmZuLs2bPIzc2tTMvOzrZpfHVpOTk5Ni0rK8umZWRk2DJMYx0uX35+vk3jeZdWtX7WwTTW6dKqtsnyVdtkPtbDNlybzMfxMM21yVfvNkl12mSaa9M77WZtEtemu44szzJMq279TGP9Va9tddpkHuZ1bbKOgoKCG8bp2qyaxrKuH65N1u/a5GvVNlk/y7G8a9ON07v+m43d1zh/rE03zlu16Z3mq01XP+t09Xu3yTzsS9VxVr22rn6XxvqZ5sbEdJapOk5fbfL4Zm16p91Om77G6epy4/RO89Wm93V0bfI8/65c/UxnPcxXE23eapzebbIc01w5vjKNuHy3apN1ujQ3Tp7zHqdr06W5cf5Ym1XHfqtr690my/DaMo9LYznvNt3YiUv7sXG6um7WZtVxVqdNvlanzap/o8TXOJmHae6Yr0xjfS6N+ZnG8i6N9TLtZuPkMXFtVv08ffWD+GrT1cV6WY5tujS+Z9rN2nRpHA/TWL9rg8dsg++ZxjZdWk3B+nKyMjF7QxSmr4vCzPXReMidqNpYTaa5Y19p7rim09yxrzR3XNNp1clT02nVyVMTaVWP70da1eP7kVb1+H6kVT2+l2nVyVPTadXJczdp7thXvqrHNZXmjn3lq3p8J2nuuLpp7rim09xxddPccXXT3PHdpLnju0lzx9VNc8d3k+aOfyytpmCdOVkZmLMxGjOM+FcaACGEEELUXpwBmLvJiP"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - The request could not be understood by the server. Incoming parameters might not be valid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 400
                    },
                    "description": {
                      "type": "string",
                      "example": "Bad Request"
                    },
                    "response_time": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2025-02-06T07:51:52.2581942Z"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - The supplied credentials, if any, are not sufficient to access the resource",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 401
                    },
                    "description": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "response_time": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2025-02-06T07:51:52.2581942Z"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found - The requested resource is not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 404
                    },
                    "description": {
                      "type": "string",
                      "example": "Not Found"
                    },
                    "response_time": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2025-02-06T07:51:52.2581942Z"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests - Too many requests have been made in a short period of time (Throttling)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 429
                    },
                    "description": {
                      "type": "string",
                      "example": "Too Many Requests"
                    },
                    "response_time": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2025-02-06T07:51:52.2581942Z"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server Error - The server could not return the representation due to an internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 500
                    },
                    "description": {
                      "type": "string",
                      "example": "Internal Server Error"
                    },
                    "response_time": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2025-02-06T07:51:52.2581942Z"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "OBJECT_ID": {
        "name": "OBJECT_ID",
        "in": "query",
        "description": "A CommBox generated number for the conversation",
        "schema": {
          "type": "integer",
          "format": "int64",
          "description": "Object ID is a CommBox generated number for the conversation"
        }
      }
    }
  }
}
````

