Mark, I have created the BAQ but need some help one how to connect to Epicor, I think once connected I can take care of the rest. I will look into the Azure authentication but meanwhile is there an example that uses Basic Auth that is like
the sample project I found in the help docs?
I found my answer. How to make a simple call to Epicor Rest API
// I got the Rest Client info from my Sysconfig file AppServerURL value
var client = new RestClient("https://ausmtsapp01.epicorsaas.com/SaaS203");
//my username and password
client.Authenticator = new HttpBasicAuthenticator("user", "password");
//API Call - I got this from the Epicor API Help section. I added the fields and filters I wanted and grabbed the URL from the output
string URLcall = string.Format("http://ausmtsapp01.epicorsaas.com/SaaS203/api/v1/xxxx");
var request = new RestRequest(URLcall, RestSharp.DataFormat.Xml);
var response = client.Get(request);
//Deserialize the Json and pull field data into fields on my form
dynamic jsonDe = JsonConvert.DeserializeObject(response.Content);
string PODetail_LineDesc = jsonDe.value[0].PODetail_LineDesc;
string PODetail_PONUM = jsonDe.value[0].PODetail_PONUM;
frmDescription.Text = PODetail_LineDesc;
frmPO.Text = PODetail_PONUM;
}
3 Likes