1、Integrations:Best Practices for Using Custom API EndpointsRuchika Sharma2Presented byRuchika SharmaTechnical Account Manager3AgendaIntroduction Session OverviewLearning Objective:Extending Web Services API endpointsLearning Objective:Using custom fields in API requestsLearning Objective:Best Practic
2、esUsing Reports and GIsUsing ODataUsing swagger.ioQ&A|Survey CompletionSummary and Key Takeaways4CPE DisclaimerThis session is NASBA-compliant,and you may get 1 CPE credit if you fulfill the following requirements:Participate in at least one quizProvide your full name and email address when you comp
3、lete a quizFailure to provide your full name and email address will result in Acumaticas inability to recognize you in our reports;thus,we will be unable to issue a CPE certificate for you.If you are not interested in getting the CPE credit,specifying your personal details is optional.Session Overvi
4、ew6Acumatica Offerings Custom/Extended endpointRetrieve custom and user defined fields with API requestRetrieve data directly from DACs and GIRetrieve Reports using API requestLearning Objectives8Learning ObjectivesIn this session,you will learn how to do the following:How to extend Web Services API
5、 endpointsWhat is required to use custom fields in API requestsWhat best practices should be applied for optimal performanceoUsing Reports and GIsoUsing ODataoUsing swagger.ioExtending Web Services API endpoints10Extending Web Services API endpointsWhat is System/Default Endpoint?System endpoint pro
6、vided out-of-boxWeb Services Endpoints screenWhat is Custom Endpoint?New endpoint that is created from scratchWhat is Extended Endpoint?Endpoint that is extended from an existing endpointThings to RememberMapping fields correctly-Header or detailsSelecting the right entity:Linked or DetailDemoQuizQu
7、izScan the QR code to participate in the quiz.To receive CPE credit,you must include your full name and email address at the end of the quiz.14Quiz ExplanationQuestion 1(Extending Web Services API endpoints)What types of endpoints can be used in Acumatica ERP for accessing web services?Select all th
8、e correct responses.SystemExternalCustomUsing$custom fields in API requests16Using$custom with Default EndpointWhat are Custom Fields?oElements that were added to the Acumatica ERP form in a customization projectoPredefined elements on an Acumatica ERP form that are not included in the entity defini
9、tionoUser-defined fields$custom ParameterHow to Retrieve?oTop-level entity:.oDetail-level entity:/.oUser-defined field:.AttributeWhen to use$custom over Extended Endpoint?oTarget screen should be present in endpointoRetrieval of limited number of fieldsDemoQuizQuizScan the QR code to participate in
10、the quiz.To receive CPE credit,you must include your full name and email address at the end of the quiz.20Quiz ExplanationQuestion 2(Using custom fields in API requests)In which of the following scenarios would you use the$custom parameter?Retrieving fields that are available in the system endpointR
11、etrieving user-defined fieldsCreating a custom endpointBest Practices22Mapping ReportsCreate an entity of Report type and use this entity to obtain the report from Acumatica ERP.Requesting the Report:oHTTP Method:POSToURL:http:/oRequest Headers:PDF:application/pdfHTML:text/htmloRequest BodyDemo23Map
12、ping GIsRetrieving Data from GI using REST APIoUsing REST APICreate an entity on Web Service Endpoints screenHTTP Method:PUTURL:http:/GI NameParameters:$expand=ResultThings to RememberoPopulate fields in Detail level entity,not top-level entityDemo:Mapping GI-AllQuotes24Using OData insteadUsed only
13、to read dataOData v3 and OData v4OData v3OData v4HTTP Method:GETURL:http:/OData/GI NameParameters:$format=jsonHTTP Method:GETURL:http:/ODatav4/DACNameParameters:$format=jsonLess maintenance as compared to GIsMore filtering options:top and skipRetrieve values from DAC directlyNo need to create custom
14、 endpoint/map new screens25Using swagger.ioWhat is OpenAPI 2.0?Specification used to describe the structure of APIMethods of a REST API are provided in a swagger.json file,which is an OpenAPI 2.0 fileWeb Service Endpoint-OpenAPI 2.0What is swagger?Describe the structure of APIs.Generate client libra
15、ries for API in many languagesNeed of swagger?To use objects from AcumaticaSaves time and low maintenanceQuizQuizScan the QR code to participate in the quiz.To receive CPE credit,you must include your full name and email address at the end of the quiz.28Quiz ExplanationQuestion 3(Best Practices:Usin
16、g OData)Which objects do you retrieve data from when using OData 4.0?Data access classesResults of generic inquiriesAcumatica ERP forms29Keep in touch!No Reliance This document is subject to change without notice.Acumatica cannot guarantee completion of any future products or program features/enhanc
17、ements described in this document,and no reliance should be placed on their availability.Confidentiality:This document,including any files contained herein,is confidential information of Acumatica and should not be disclosed to third parties.Kwiat 18K Diamond Pendant NecklaceSaddleback Leather Fligh
18、t Bag BriefcaseWe want your feedback.Q&AEvery survey completed=an entry to win!Clive Coffee Lucca A53 Mini V2Espresso MachineComplete a survey in the Summit app for an entry to win one of these awesome customer prizes!Ruchika SSession Summary31Conclusion and Key Takeaways Extend Web Services API PracticesMapping R OData3 OData4