Skip to main content
Version: 5.9.6

GetMyCountryCode

public BackendReturnObject GetMyCountryCode();

Description

Retrieves your country code.
Your country code can be also looked up using the GetUserInfo method.

Example

Synchronous

BackendReturnObject bro = Backend.BMember.GetMyCountryCode();
string countryByString = bro.GetReturnValuetoJSON()["country"]["S"].ToString();

//Convert to country code
BackEnd.GlobalSupport.CountryCode countryCode = BackEnd.GlobalSupport.CountryCodeDic.GetCountryName(countryByString);

Asynchronous

Backend.BMember.GetMyCountryCode((callback) =>
{
string countryBySring = callback.GetReturnValuetoJSON()["country"]["S"].ToString();

//Convert to country code
BackEnd.GlobalSupport.CountryCode countryCode =
BackEnd.GlobalSupport.CountryCodeDic.GetCountryName(countryBySring);
});

SendQueue

SendQueue.Enqueue(Backend.BMember.GetMyCountryCode, (callback) =>
{
string countryByString = callback.GetReturnValuetoJSON()["country"]["S"].ToString();

//Convert to country code
BackEnd.GlobalSupport.CountryCode countryCode =
BackEnd.GlobalSupport.CountryCodeDic.GetCountryName(countryByString);
});

Return cases

Success cases

When loaded successfully
statusCode : 200

returnValue : refer to GetReturnValuetoJSON

Error cases

When the country code does not exist
statusCode : 404
errorCode : NotFoundException

GetReturnValuetoJSON

{
country : {S : "KR"}
}