Skip to content

Business account

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

InstagramApiSharp supports Business accounts.

You can find all business functions in IInstaApi.BusinessProcessor class.

How can I get my business account information?

var businessAccountInformation = await InstaApi.BusinessProcessor
    .GetBusinessAccountInformationAsync();

How can I get my account statistics?

var statistics = await InstaApi.BusinessProcessor.GetStatisticsAsync();

How can I get my promotable medias?

var promotableMedias = await InstaApi.BusinessProcessor.GetPromotableMediaFeedsAsync();

How can I get insights for single media?

var insights = await InstaApi.BusinessProcessor.GetMediaInsightsAsync("MEDIA PK");

Note: You should pass InstaMedia.Pk to above function!!!!

How can I get full insights for single media?

var fullInsights = await InstaApi.BusinessProcessor.GetFullMediaInsightsAsync("MEDIA ID");

Note: You should pass InstaMedia.InstaIdentifier to above function!!!

How can I star a thread?

var starThread = await InstaApi.BusinessProcessor.StarDirectThreadAsync("THREAD ID");

How can I unstar a thread?

var unstarThread = await InstaApi.BusinessProcessor.UnStarDirectThreadAsync("THREAD ID");

How can I get instagram partners buttons?

var partnersButton = await InstaApi.BusinessProcessor.GetBusinessPartnersButtonsAsync();

How can I add/change a button to my account?

var desirePartner = partnersButton.Value.Find(p => p.PartnerName == "Yelp");
var uri = new Uri("https://www.yelp.com/search?find_desc=iran");
var addOrChangeButton = await InstaApi.BusinessProcessor
    .AddOrChangeBusinessButtonAsync(desirePartner, uri);

How can I validate a url for a business partner ?

var validateUrl = await InstaApi.BusinessProcessor.ValidateUrlAsync(desirePartner, uri);

How can I remove current button?

var removeButton = await InstaApi.BusinessProcessor.RemoveBusinessButtonAsync();

How can I get suggested categories?

var sugesstedCategories = await InstaApi.BusinessProcessor.GetSuggestedCategoriesAsync();

How can I get categories?

var categories = await InstaApi.BusinessProcessor.GetCategoriesAsync();

How can I get sub categories?

var categories = await InstaApi.BusinessProcessor.GetCategoriesAsync();
var firstCategory = categories.Value.FirstOrDefault();
var subCategories = await InstaApi.BusinessProcessor
    .GetSubCategoriesAsync(firstCategory.CategoryId);

How can I set/change my account category?

var firstSubCategory = subCategories.Value.FirstOrDefault();
var setOrChangeSubCategory = await InstaApi.BusinessProcessor
    .ChangeBusinessCategoryAsync(firstSubCategory.CategoryId);

How can I search a city or town location?

var cityLocation = await InstaApi.BusinessProcessor.SearchCityLocationAsync("Kazerun");

How can I update my business information?

var myLocation = cityLocation.Value.FirstOrDefault();
var phoneWithCountryCode = "";
var contactMethodType = InstagramApiSharp.Enums.InstaBusinessContactType.Call;
var streetAddress = "";
var zipCode = "";

var updateBusinessInfo = await InstaApi.BusinessProcessor
    .UpdateBusinessInfoAsync(phoneWithCountryCode, myLocation,
    streetAddress,zipCode, contactMethodType);

Note 1: set null for phoneNumber, if don't want to change that!

Note 2: set null for location, if want to change that!

Note 3: set null for contactMethodType, if you don't want to change that.

How can I remove my business location?

var removeLocation = await InstaApi.BusinessProcessor.RemoveBusinessLocationAsync();