How to call the API?

Varshini S
Varshini S used Ask the Experts™
on
I'm new to API. Please let me know, How to call this below API


I have received the below help document.
I don't know how to form a query string to call this API.

http://192.168.1.5:89/Help/Api/GET-api-GetCustomerAndOrderDetail-GetCustomerDetail

GET api/GetCustomerAndOrderDetail/GetCustomerDetail

Body Parameters
LastName, CustomerCode, Email

LastName
Input the Customer's Last Name as a parameter to get the Customer detail.
Last name is mandatory and it should be a combination of (LastName and CustomerCode, OR (LastName and Email).
Type: Required :string ,Max length: 50


CustomerCode
Input the CustomerCode and the LastName to get the Customer detail.
Type: string , Max length: 20


Email

Input the Email and the LastName to get the Customer detail.
Type: string, Max length: 100
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Ryan ChongSoftware Team Lead

Commented:
something like this should work:

http://192.168.1.5:89/Api/GET-api-GetCustomerAndOrderDetail-GetCustomerDetail?LastName=yourLastName&CustomerCode=yourCustomerCode&Email=yourEmail@domain.com

Open in new window


Many ways you can call that web API, a sample how to do it:

WebClient vs HttpClient vs HttpWebRequest
https://www.diogonunes.com/blog/webclient-vs-httpclient-vs-httpwebrequest/
Ryan ChongSoftware Team Lead

Commented:
you can also use tool such as Postman for the testing.
https://www.getpostman.com/
Also, don't forget to use swagger.io

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial