Zoho CRM Record Photo

Record. Published by Zoho in its first-party OpenAPI 3.1.0 repository github.com/zoho/crm-oas; 3 operation(s).

OpenAPI Specification

zoho-crm-record-photo-openapi.json Raw ↑
{
  "openapi": "3.1.0",
  "info": {
    "title": "Record Photo",
    "description": "Record",
    "version": "8"
  },
  "servers": [
    {
      "url": "https://zohoapis.{dc}/crm/{version}",
      "description": "API Server URL",
      "variables": {
        "dc": {
          "enum": [
            "com",
            "eu",
            "in",
            "cn",
            "au"
          ],
          "default": "com",
          "description": "API Server URL TLD"
        },
        "version": {
          "default": "v8",
          "description": "API Version"
        }
      }
    }
  ],
  "security": [
    {
      "iam-oauth2-schema": [
        "ZohoCRM.modules.ALL",
        "ZohoCRM.modules.DELETE",
        "ZohoCRM.modules.CREATE",
        "ZohoCRM.modules.READ"
      ]
    }
  ],
  "paths": {
    "/{module}/{record}/photo": {
      "get": {
        "summary": "Get a photo",
        "description": "Retrieve a photo for a record",
        "operationId": "getPhoto",
        "parameters": [
          {
            "$ref": "#/components/parameters/Module"
          },
          {
            "$ref": "#/components/parameters/Record"
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved the photo",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Binary image data representing the record photo"
                }
              }
            }
          },
          "204": {
            "description": "No photo found for the record"
          },
          "400": {
            "description": "Bad request - Invalid URL pattern, data, or module",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Error response object",
                  "additionalProperties": false,
                  "properties": {
                    "code": {
                      "type": "string",
                      "description": "Error code indicating the type of error",
                      "enum": [
                        "INVALID_URL_PATTERN",
                        "INVALID_DATA",
                        "INVALID_MODULE"
                      ]
                    },
                    "message": {
                      "type": "string",
                      "description": "Error message describing the error",
                      "maxLength": 1000
                    },
                    "status": {
                      "type": "string",
                      "description": "Status of the response",
                      "enum": [
                        "error"
                      ]
                    },
                    "details": {
                      "oneOf": [
                        {
                          "type": "object",
                          "description": "Empty details object",
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "description": "Details object containing invalid ID",
                          "additionalProperties": false,
                          "properties": {
                            "id": {
                              "type": "string",
                              "description": "The invalid ID",
                              "maxLength": 100
                            }
                          },
                          "required": [
                            "id"
                          ]
                        },
                        {
                          "type": "object",
                          "description": "Details object containing resource path index",
                          "additionalProperties": false,
                          "properties": {
                            "resource_path_index": {
                              "type": "integer",
                              "format": "int32",
                              "description": "Index of the invalid resource path"
                            }
                          },
                          "required": [
                            "resource_path_index"
                          ]
                        }
                      ]
                    }
                  },
                  "required": [
                    "code",
                    "message",
                    "status",
                    "details"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.READ"
            ]
          }
        ]
      },
      "post": {
        "summary": "Upload a photo",
        "description": "Upload a photo for a record",
        "operationId": "uploadPhoto",
        "parameters": [
          {
            "$ref": "#/components/parameters/Module"
          },
          {
            "$ref": "#/components/parameters/Record"
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "description": "Request body for uploading a photo file",
                "additionalProperties": false,
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "The photo file to upload"
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully uploaded the photo",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Success response object",
                  "additionalProperties": false,
                  "properties": {
                    "code": {
                      "type": "string",
                      "description": "Success code indicating the operation completed successfully",
                      "enum": [
                        "SUCCESS"
                      ]
                    },
                    "message": {
                      "type": "string",
                      "description": "Success message describing the result",
                      "maxLength": 1000
                    },
                    "status": {
                      "type": "string",
                      "description": "Status of the response",
                      "enum": [
                        "success"
                      ]
                    },
                    "details": {
                      "type": "object",
                      "description": "Additional details about the operation",
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "code",
                    "message",
                    "status",
                    "details"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid URL pattern, data, or module",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Error response for photo upload operation",
                  "oneOf": [
                    {
                      "type": "object",
                      "description": "Error response object",
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Error code indicating the type of error",
                          "enum": [
                            "INVALID_URL_PATTERN",
                            "INVALID_DATA",
                            "INVALID_MODULE",
                            "CANNOT_PERFORM_ACTION",
                            "NOT_REVIEWED",
                            "NOT_APPROVED",
                            "RECORD_LOCKED"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "Error message describing the error",
                          "maxLength": 1000
                        },
                        "status": {
                          "type": "string",
                          "description": "Status of the response",
                          "enum": [
                            "error"
                          ]
                        },
                        "details": {
                          "oneOf": [
                            {
                              "type": "object",
                              "description": "Empty details object",
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "description": "Details object containing invalid ID",
                              "additionalProperties": false,
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "description": "The invalid ID",
                                  "maxLength": 100
                                }
                              },
                              "required": [
                                "id"
                              ]
                            },
                            {
                              "type": "object",
                              "description": "Details object containing resource path index",
                              "additionalProperties": false,
                              "properties": {
                                "resource_path_index": {
                                  "type": "integer",
                                  "format": "int32",
                                  "description": "Index of the invalid resource path"
                                }
                              },
                              "required": [
                                "resource_path_index"
                              ]
                            }
                          ]
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "status",
                        "details"
                      ]
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.CREATE"
            ]
          }
        ]
      },
      "delete": {
        "summary": "Delete a photo",
        "description": "Delete a photo for a record",
        "operationId": "deletePhoto",
        "parameters": [
          {
            "$ref": "#/components/parameters/Module"
          },
          {
            "$ref": "#/components/parameters/Record"
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully deleted the photo",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Success response object",
                  "additionalProperties": false,
                  "properties": {
                    "code": {
                      "type": "string",
                      "description": "Success code indicating the operation completed successfully",
                      "enum": [
                        "SUCCESS"
                      ]
                    },
                    "message": {
                      "type": "string",
                      "description": "Success message describing the result",
                      "maxLength": 1000
                    },
                    "status": {
                      "type": "string",
                      "description": "Status of the response",
                      "enum": [
                        "success"
                      ]
                    },
                    "details": {
                      "type": "object",
                      "description": "Additional details about the operation",
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "code",
                    "message",
                    "status",
                    "details"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid URL pattern, data, or module",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Error response for photo delete operation",
                  "oneOf": [
                    {
                      "type": "object",
                      "description": "Error response object",
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Error code indicating the type of error",
                          "enum": [
                            "INVALID_URL_PATTERN",
                            "INVALID_DATA",
                            "INVALID_MODULE"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "Error message describing the error",
                          "maxLength": 1000
                        },
                        "status": {
                          "type": "string",
                          "description": "Status of the response",
                          "enum": [
                            "error"
                          ]
                        },
                        "details": {
                          "oneOf": [
                            {
                              "type": "object",
                              "description": "Empty details object",
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "description": "Details object containing invalid ID",
                              "additionalProperties": false,
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "description": "The invalid ID",
                                  "maxLength": 100
                                }
                              },
                              "required": [
                                "id"
                              ]
                            },
                            {
                              "type": "object",
                              "description": "Details object containing resource path index",
                              "additionalProperties": false,
                              "properties": {
                                "resource_path_index": {
                                  "type": "integer",
                                  "format": "int32",
                                  "description": "Index of the invalid resource path"
                                }
                              },
                              "required": [
                                "resource_path_index"
                              ]
                            }
                          ]
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "status",
                        "details"
                      ]
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.DELETE"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "parameters": {
      "Module": {
        "name": "module",
        "in": "path",
        "required": true,
        "description": "The API name of the module",
        "schema": {
          "type": "string",
          "maxLength": 100
        }
      },
      "Record": {
        "name": "record",
        "in": "path",
        "required": true,
        "description": "The record ID",
        "schema": {
          "type": "string",
          "format": "int64",
          "maxLength": 20
        }
      }
    },
    "securitySchemes": {
      "iam-oauth2-schema": {
        "type": "oauth2",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://accounts.zoho.com/oauth/v2/auth",
            "tokenUrl": "https://accounts.zoho.com/oauth/v2/token",
            "refreshUrl": "https://accounts.zoho.com/oauth/v2/token",
            "scopes": {
              "ZohoCRM.modules.ALL": "Access all CRM modules",
              "ZohoCRM.modules.DELETE": "Delete Record Photo",
              "ZohoCRM.modules.CREATE": "Create Record Photo",
              "ZohoCRM.modules.READ": "Read Record Photo"
            }
          }
        }
      }
    }
  }
}