[progress Communities] [progress Openedge Abl] Forum Post: Request Using Dynamic365 Api

  • Thread starter Thread starter goo
  • Start date Start date
Status
Not open for further replies.
G

goo

Guest
11.7 Where can I find some documentation of how to use the OpenEdge.Net stuff? I am trying to communicate With Dynamics365 using OpenEdge HTTP stuff. I have received a token, and Wonder oAuthParam = AuthenticationParameters:CreateFromResourceUrlAsync(oUri). PAUSE 0.3 NO-MESSAGE. oAuthContext = NEW AuthenticationContext(oAuthParam:Result:Authority). PAUSE 0.3 NO-MESSAGE. oClientCred = NEW Microsoft.IdentityModel.Clients.ActiveDirectory.UserCredential(username,password). PAUSE 0.3 NO-MESSAGE. Token = oAuthContext:AcquireToken(oAuthParam:Result:Resource,clientId,oClientCred):AccessToken. So far, ok. Then I want to send a request for some member information: METHOD PUBLIC VOID getMedlem(input ipMedlemNr as int ): def var ContactQuery as char no-undo. ContactQuery = "contacts?$select=contactid&$filter=acan_medlemsnummer eq '~{" + string(ipMedlemNr) + "~}'&$top=1". oClient = ClientBuilder:Build():Client. oURI:PathAndQuery = ContactQuery. oRequest = RequestBuilder:Get(oURI). /* :AcceptJson()*/ /* :Request. */ oRequest:CharacterEncoding = 'UTF-8'. oResponse = oClient:Execute(oRequest). It will not compile, and If I remove the comments for :AcceptJson and :Req.. it also gives me errors on those.. I am trying to implement from this examplecode in C#: /* var wc = new WebClient(); */ /* wc.Encoding = Encoding.UTF8; */ /* */ /* wc.BaseAddress = webApiBaseUrl; */ /* */ /* wc.Headers.Add("OData-MaxVersion", "4.0"); */ /* wc.Headers.Add("OData-Version", "4.0"); */ /* wc.Headers.Add("Accept", "application/json"); */ /* wc.Headers.Add("Content-Type", "application/json;charset=utf-8");*/ /* wc.Headers.Add("Authorization", "Bearer " + accessToken); */ /* */ /* return wc; */ 1. What is wrong With the code?

Continue reading...
 
Status
Not open for further replies.
Back
Top