Access code using MYOB Api in c#

This thread is now closed to new comments.
Some of the links and information provided in this thread may no longer be available or relevant.
If you have a question please start a new post.
ZamanKhan
3 Posts
User

3Posts

0Kudos

0Solutions

Access code using MYOB Api in c#

I tried but unable to access the code. Please have a look on below code.

private const string CsOAuthServer = "https://secure.myob.com/oauth2/account/authorize/";

private const string CsOAuthScope = "CompanyFile";
try
{
string url1 = string.Format("{0}?client_id={1}&redirect_uri={2}&response_type=code&scope={3}&state={4}", CsOAuthServer,
"sytcvymfdt3xfa9q38XXXXX", HttpUtility.UrlEncode("http://desktop"), CsOAuthScope, "emFtYW4wNzFzZUBnbWFpbC5jb206IUAxMXXXXX");
HttpClient client = new HttpClient();
client.BaseAddress = new Uri(url1);
client.DefaultRequestHeaders.Accept.Add(
new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("text/plain"));
HttpResponseMessage response = client.GetAsync("authorize").Result;
var REG = response.Content.ReadAsStringAsync();
}
catch (Exception ex)
{

}
Please see the video if you need more information

 

Reference Link:
https://myobapi.tumblr.com/post/60294451539/passing-state-via-oauth

 

**Editd by MYOB Moderator**

2 REPLIES 2
Hannah_B
MYOB Moderator
142 Posts
MYOB Moderator
Australia
MYOB Moderator

142Posts

33Kudos

25Solutions

Re: Access code using MYOB Api in c#

Hi @ZamanKhan 

 

Thanks for reaching out, I can see you have emailed us at developers@myob.com. I have replied to your email via developers. 

 

Please note I have removed the video link from above and edited this post due to sensitive information within this.

 

Thanks,


Thanks,
@Hannah_B


MYOB API Specialist


MYOB API Support Centre|MYOB App Marketplace|MYOB AccountRight API Endpoint Doc's



Did my answer help?


Mark it as a Solution

ZamanKhan
3 Posts
User

3Posts

0Kudos

0Solutions

Re: Access code using MYOB Api in c#

Please help me Still I am stuck here....

Didn't find your answer here?

Try using advanced search to find a post more easily Advanced Search
or
Get the conversation started and make a new post Start a Post