![]() Greytrix – a globally recognized and one of the oldest Sage Development Partner is a one-stop solution provider for Sage ERP and Sage CRM organizational needs. #SAGE X3 API CODE#This blog helps us to understand the mapping of fields from POSTMAN tool to X3 REST web services and code used to call an external API by using EXEC_REST_ES function by passing credentials in header variables. ![]() Response from API while executing the code above in X3. “The narration of function and its parameter used to call an external/outgoing REST web service from ASYRRESTCLI library” The blog for the ASYRRESTCLI function and its parameters to be passed for the #SAGE X3 API PASSWORD#“Basic” followed by BASE 64 format of Username: Password Val HVAL(1) as ” Basic MTcwZWU5MmEyODOTo= “ The REST web services through code, In that case Header variable should contain Login authentication screen, if it is successful then pass those credentials to There is an requirement of sending Username and password directly through code Result json format is stored in YRESBODY Variable. Will return status code as integer value which shows success or failure and The variable YURI with the remaining part of URLĮXEC_REST_WS function from ASYRRESTCLI library with all required parameters and The variable YAPI -REST web service Name to ” CreateID “ ![]() The variable HVAL(2)- Header variable of array index 2 to application/Json. The variable HCOD(2)- Header code of array index 2 to Content-type. The variable HVAL(1) -Header variable of array index 1 to username and password ![]() The variable HCOD(1)- Header code of array index 1 to Authorization. Is specified in Key-value pair, Header should contain authorization and #Declaring Header ,Method and Path of URLĪSYRRESTCLI.EXEC_REST_WS(YAPI,YMTD,YURI,PCOD,PVAL,HCOD,HVAL,YREQBODY,0,”,RESHEAD,YRESBODY) LOCAL CLBFILE YMTD,YREQBODY,YRESBODY,RESHEAD(0) #Declaration of Variables used in executing Parameters: PARAM tab in postman is mapped with Parameters fields in X3 as Key value Pair Fig3: Rest Web service screen Name Field : Enter any user defined fieldĪuthentication: Choose Basic Authentication and Enter credentials ,Username and Fig2: Postman- Body tab screenĪll->Administration->Administration->Rest Web services The data, depends on type of request method, to be sent with request, raw formĢ.HTTP Response - On click of Send Button, Response will display in JSON Format. Content-type, i.e.,Īpplication/json which is used for the requests and responses A content-type describes the format of object data. ![]() Request Header: In request headers it contains key-value of the Select the Basic Auth on Type field and enter valid Username and Password. Authorization: An authorization token, included with requests, is used to identify the requester. Request URL:URL to make the http request. Send some additional information inside the body of the request to the server. Post Method, A POST request is a method that is used when we need to There are mainly four request methods, used for creating/updating, retrieving Request Method: Request method defines the type of request to be made. Request contains of Request Method, Request URL, Authorization, Request Request is the simplest way possible to make http calls. In this blog, we are going to visualize the mapping of fields from postman to x3 Rest web services. REST services are available in sage x3 that returns data in a JSON format. Postman is a simple GUI for sending HTTP requests and viewing responses. #SAGE X3 API SOFTWARE#We come across the scenario, where we will use POSTMAN software tool to examine the working of external API. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |