Box

Box User Avatars API

User avatars are JPG or PNG files uploaded to Box to represent the user image. They are then displayed in the user account.

Documentation

📖
Documentation
https://developer.box.com/reference/get-authorize
📖
Documentation
https://developer.box.com/reference/post-oauth2-token
📖
Documentation
https://developer.box.com/reference/post-files-id-copy
📖
Documentation
https://developer.box.com/reference/post-file-requests-id-copy
📖
Documentation
https://developer.box.com/reference/post-folders-id-copy
📖
Documentation
https://developer.box.com/reference/post-folder-locks
📖
Documentation
https://developer.box.com/reference/post-metadata-templates-schema
📖
Documentation
https://developer.box.com/reference/post-metadata-cascade-policies
📖
Documentation
https://developer.box.com/reference/post-metadata-queries-execute-read
📖
Documentation
https://developer.box.com/reference/post-comments
📖
Documentation
https://developer.box.com/reference/post-collaborations
📖
Documentation
https://developer.box.com/reference/post-tasks
📖
Documentation
https://developer.box.com/reference/post-task-assignments
📖
Documentation
https://developer.box.com/reference/put-files-id--add-shared-link
📖
Documentation
https://developer.box.com/reference/put-folders-id--add-shared-link
📖
Documentation
https://developer.box.com/reference/post-web-links
📖
Documentation
https://developer.box.com/reference/put-web-links-id--add-shared-link
📖
Documentation
https://developer.box.com/reference/post-users
📖
Documentation
https://developer.box.com/reference/post-invites
📖
Documentation
https://developer.box.com/reference/post-groups
📖
Documentation
https://developer.box.com/reference/post-group-memberships
📖
Documentation
https://developer.box.com/reference/post-webhooks
📖
Documentation
https://developer.box.com/reference/post-files-id-metadata-global-boxSkillsCards
📖
Documentation
https://developer.box.com/reference/options-events
📖
Documentation
https://developer.box.com/reference/get-collections-id
📖
Documentation
https://developer.box.com/reference/get-recent-items
📖
Documentation
https://developer.box.com/reference/post-retention-policies
📖
Documentation
https://developer.box.com/reference/post-retention-policy-assignments
📖
Documentation
https://developer.box.com/reference/post-legal-hold-policies
📖
Documentation
https://developer.box.com/reference/post-legal-hold-policy-assignments
📖
Documentation
https://developer.box.com/reference/get-file-version-retentions-id
📖
Documentation
https://developer.box.com/reference/get-file-version-legal-holds-id
📖
Documentation
https://developer.box.com/reference/post-shield-information-barriers-change-status
📖
Documentation
https://developer.box.com/reference/post-shield-information-barrier-reports
📖
Documentation
https://developer.box.com/reference/post-shield-information-barrier-segments
📖
Documentation
https://developer.box.com/reference/post-shield-information-barrier-segment-members
📖
Documentation
https://developer.box.com/reference/post-shield-information-barrier-segment-restrictions
📖
Documentation
https://developer.box.com/reference/get-device-pinners-id
📖
Documentation
https://developer.box.com/reference/post-terms-of-services
📖
Documentation
https://developer.box.com/reference/post-terms-of-service-user-statuses
📖
Documentation
https://developer.box.com/reference/post-collaboration-whitelist-entries
📖
Documentation
https://developer.box.com/

Specifications

Other Resources

OpenAPI Specification

box-user-avatars-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Box Authorize Authorization User Avatars API
  description: Needs a description.
tags:
- name: User Avatars
  description: 'User avatars are JPG or PNG files

    uploaded to Box to represent the

    user image. They are then displayed

    in the user account.'
  x-box-tag: avatars
paths:
  /users/{user_id}/avatar:
    get:
      operationId: get_users_id_avatar
      x-box-tag: avatars
      summary: Box Get user avatar
      tags:
      - User Avatars
      description: Retrieves an image of a the user's avatar.
      parameters:
      - name: user_id
        description: The ID of the user.
        example: '12345'
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: 'When an avatar can be found for the user the

            image data will be returned in the body of the

            response.'
          content:
            image/jpg:
              schema:
                type: string
                format: binary
                description: The avatar
        default:
          description: An unexpected client error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
    post:
      operationId: post_users_id_avatar
      x-box-tag: avatars
      summary: Box Add or update user avatar
      tags:
      - User Avatars
      description: Adds or updates a user avatar.
      parameters:
      - name: user_id
        description: The ID of the user.
        example: '12345'
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              required:
              - pic
              properties:
                pic:
                  type: string
                  format: binary
                  description: 'The image file to be uploaded to Box.

                    Accepted file extensions are `.jpg` or `.png`.

                    The maximum file size is 1MB.'
      responses:
        '200':
          description: '* `ok`: Returns the `pic_urls` object with URLs to existing

            user avatars that were updated.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserAvatar'
        '201':
          description: '* `created`: Returns the `pic_urls` object with URLS to user avatars

            uploaded to Box with the request.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserAvatar'
        '400':
          description: "* `bad_request`: Returns an error when:\n    * An image is not included in the request\n    * The uploaded file is empty\n    * The image size exceeds 1024 * 1024 pixels\n    or 1MB\n    * The file extension is other than `.jpg` or `.png`."
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '403':
          description: '* `forbidden`: Returns an error if the user does not have permissions

            necessary to upload an avatar or is not activated.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: '* `not_found`: Returns an error if the user

            does not exist or cannot be found.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        default:
          description: An unexpected client error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
    delete:
      operationId: delete_users_id_avatar
      x-box-tag: avatars
      summary: Box Delete user avatar
      tags:
      - User Avatars
      description: 'Removes an existing user avatar.

        You cannot reverse this operation.'
      parameters:
      - name: user_id
        description: The ID of the user.
        example: '12345'
        in: path
        required: true
        schema:
          type: string
      responses:
        '204':
          description: '* `no_content`: Removes the avatar and returns an empty response.'
        '403':
          description: "* `forbidden`: Returned if the user does not have necessary permissions\n or is not activated."
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: "* `not_found`: Returned if the user or user avatar does not exist\n or cannot be found."
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        default:
          description: An unexpected client error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
components:
  schemas:
    UserAvatar:
      title: User avatar
      type: object
      x-box-resource-id: user_avatar
      x-box-tag: avatars
      description: 'A resource holding URLs to the

        avatar uploaded to a Box application.'
      properties:
        pic_urls:
          type: object
          description: Represents an object with user avatar URLs.
          properties:
            small:
              type: string
              description: The location of a small-sized avatar.
              example: 'https://app.box.com/index.php?rm=pic_storage_auth&pic=euks! pac3kv01!7B6R5cZLmurEV_xB-KkycPk8Oi7oENUX2O_qUtIuO4342CG IldyCto9hqiQP7uxqYU5V2w63Ft4ln4UVVLDtDZu903OqzkflY2O-Lq00 ubA29xU-RJ6b_KzJEWRYgUhX1zEl3dzWo12g8eWRE2rStf123DF7AYahNqM 1BmLmviL_nODc7SDQHedTXPAjxURUAra5BvtLe7B05AizbNXdPlCNp-LNh _S-eZ_RjDXcGO-MkRWd_3BOMHnvjf450t5BfKoJ15WhEfiMlfXH1tmouHXrsC 66cT6-pzF9E40Iir_zThqSlrFxzP_xcmXzHapr_k-0E2qr2TXp4iC396TSlEw

                '
            large:
              type: string
              description: The location of a large-sized avatar.
              example: 'https://app.box.com/index.php?rm=pic_storage_auth&pic=euks

                pac3kv01!lipGQlQQOtCTCoB6zCOArUjVWLFJtLr5tn6aOZMCybhRx0NNuFQbVI36nw

                jtEk5YjUUz1KVdVuvU2yDhu_ftK_bvxeKP1Ffrx9vKGVvJ-UJc1z32p6n2CmFzzpc

                gSoX4pnPhFgydAL-u9jDspXUGElr-htDG_HPMiE9DZjqDueOxXHy8xe22wbaPAheC

                ao1emv8r_fmufaUgSndeMYmyZj-KqOYsLBrBNgdeiK5tZmPOQggAEUmyQPkrd8W92TQ6sSlIp0r'
            preview:
              type: string
              description: The location of the avatar preview.
              example: 'https://app.box.com/index.php?rm=pic_storage_auth&pic=euks!

                pac3kv01!8UcNPweOOAWj2DtHk_dCQB4wJpzyPkl7mT5nHj5ZdjY92ejYCBBZc95--403b29CW

                k-8hSo_uBjh5h9QG42Ihu-cOZ-816sej1kof3SOm5gjn7qjMAx89cHjUaNK-6XasRqSNboenjZ

                04laZuV9vSH12BZGAYycIZvvQ5R66Go8xG5GTMARf2nBU84c4H_SL5iws-HeBS4oQJWOJh6FBl

                sSJDSTI74LGXqeZb3EY_As34VFC95F10uozoTOSubZmPYylPlaKXoKWk2f9wYQso1ZTN7sh-Gc

                9Kp43zMLhArIWhok0Im6FlRAuWOQ03KYgL-k4L5EZp4Gw6B7uqVRwcBbsTwMIorWq1g'
    ClientError:
      title: Client error
      type: object
      x-box-resource-id: client_error
      description: A generic error
      properties:
        type:
          description: error
          example: error
          type: string
          enum:
          - error
          nullable: false
        status:
          description: The HTTP status of the response.
          example: 400
          type: integer
          format: int32
          nullable: false
        code:
          description: A Box-specific error code
          example: item_name_invalid
          type: string
          enum:
          - created
          - accepted
          - no_content
          - redirect
          - not_modified
          - bad_request
          - unauthorized
          - forbidden
          - not_found
          - method_not_allowed
          - conflict
          - precondition_failed
          - too_many_requests
          - internal_server_error
          - unavailable
          - item_name_invalid
          - insufficient_scope
        message:
          description: A short message describing the error.
          example: Method Not Allowed
          type: string
          nullable: false
        context_info:
          description: 'A free-form object that contains additional context

            about the error. The possible fields are defined on

            a per-endpoint basis. `message` is only one example.'
          type: object
          nullable: true
          properties:
            message:
              type: string
              description: More details on the error.
              example: Something went wrong.
        help_url:
          description: A URL that links to more information about why this error occurred.
          example: https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/
          type: string
          nullable: false
        request_id:
          description: 'A unique identifier for this response, which can be used

            when contacting Box support.'
          type: string
          example: abcdef123456
          nullable: false