Instagram\Instagram::changeProfilePicture PHP Method

changeProfilePicture() public method

Change Profile Picture
public changeProfilePicture ( string $path ) : ChangeProfilePictureAccountResponse
$path string File path of Profile Picture to Upload
return Instagram\API\Response\ChangeProfilePictureAccountResponse
    public function changeProfilePicture($path)
    {
        if (!$this->isLoggedIn()) {
            throw new InstagramException("You must be logged in to call changeProfilePicture().");
        }
        $request = new ChangeProfilePictureAccountRequest($this, $path);
        $response = $request->execute();
        if (!$response->isOk()) {
            throw new InstagramException(sprintf("Failed to changeProfilePicture: [%s] %s", $response->getStatus(), $response->getMessage()));
        }
        return $response;
    }