Skip to content

Account

Ramtin Jokar edited this page Dec 16, 2018 · 12 revisions

You can find all account functions in IInstaApi.AccountProcessor class.

Note: this is related to your own account. you can do these jobs with this class:

How can I get my own profile for editing purpose?

var requestForEditProfile = await InstaApi.AccountProcessor
    .GetRequestForEditProfileAsync();

How can I edit my profile?

string name = "Ramtin Jokar"; // leave null if you don't want to change it
InstaGenderType? gender = InstaGenderType.Male; // leave null if you don't want to change it
string email = "[email protected]"; // leave null if you don't want to change it
string url = ""; // leave empty if you have no site/blog | leave null if you don't want to change it
string phone = "+989171234567"; // leave null if you don't want to change it
string biography = "C# Programmer\n\nIRaN/FARS/KaZeRouN"; // leave null if you don't want to change it
string newUsername = ""; // leave empty if you don't want to change your username

var editProfile = await InstaApi.AccountProcessor
                .EditProfileAsync(name, biography, url, email, phone, gender, newUsername);

How can I change my name and my phone number?

string name = "Ramtin Jokar";
string phone = "+989171234567";
var setNameAndPhone = await InstaApi.AccountProcessor
                .SetNameAndPhoneNumberAsync(name, phone);

How can I change my biography?

string bio = "C# Programmer\n\nIRaN/FARS/KaZeRouN";
var setBiography = await InstaApi.AccountProcessor
                .SetBiographyAsync(bio);

How can I change my profile picture?

var picturePath = @"c:\someawesomepicture.jpg";
var pictureBytes = File.ReadAllBytes(picturePath);

var changeProfilePicture = await InstaApi.AccountProcessor
                .ChangeProfilePictureAsync(pictureBytes);

Note: only JPG and JPEG format will accept it in instagram!

How can I remove my profile picture?

var removeProfilePicture = await InstaApi.AccountProcessor
                .RemoveProfilePictureAsync()

How can I get story settings?

var storySettings = await InstaApi.AccountProcessor
                .GetStorySettingsAsync();

You can find more functions in: Story settings functions

How can I check username availability?

var user = "rmt4006";
var checkUsername = await InstaApi.AccountProcessor
                .CheckUsernameAsync(user);

You can find other functions like security settings(enable/disable two factor and get two factor backup codes). in this class:

Account example class