Skip to content

Latest commit

 

History

History
86 lines (68 loc) · 1.12 KB

updateProfilePic.md

File metadata and controls

86 lines (68 loc) · 1.12 KB

Update profile Picture

URL : /api/user/profile-pic

METHOD : PATCH

Auth required : YES

Headers:

{
  "Auth": "<BEARER>__<TOKEN>"
}

Body:

{
  "profilePic": // <JPEG> or <PNG>
}

Success Response:

code : 201

{
    "status": "success",
    "message": "Profile Picture Updated Successfully",
    "data": {
        "user": {
            "profilePic": {
                "secure_url": "...",
                "public_id": "..."
            },
            "_id": "656792084cd8dd1ef2501489",
            "userName": "yhya101",
            "email": "[email protected]",
            "updatedAt": "2023-11-29T22:22:43.807Z"
        }
    }
}

Fail Response:

code : 400

{
  "status": "fail",
  "code": 400,
  "message": "profile picture is required"
}

code : 401

{
  "status": "fail",
  "code": 401,
  "message": "Invalid Token"
}
{
  "status": "fail",
  "code": 401,
  "message": " Token Is Required"
}

code : 404

{
  "status": "fail",
  "code": 404,
  "message": "User Not Found"
}