Get token
token=$(curl –data "username=&password=" HTTPS://ADMIN.domain.COM/API/GETTOKEN)
Call
curl –data "token=**&records=1" HTTPS://ADMIN.domain.COM/API/GETLEADS
==== Params ====
- string TOKEN,
- DateTime STARTDATE,
- DateTime ENDDATE,
- string OUTPUTTYPE, (default value = "json")
- int RECORDS
As a response, you will receive JSON result containing records data with calls.
— Mike W 2018/11/29 16:11
Main Steps
- This easy method installs curl on windows
- Open a PowerShell command line as Administrator and paste in the following :
- Set-ExecutionPolicy RemoteSigned → Select Y(Yes).
- pip install choco curl
- https://chocolatey.org/install → copy the second link PowerShell.exe
- remove-item alias:curl
GET TOKEN & Export .Json File
- curl –data "Username=test&Password=test123" http://ADMIN2.domain.COM/API/GETTOKEN -k
- curl –data "token=……&startDate=2000-01-01&endDate=2020-01-01&records=10&outputType=json" https://admin2.domain.com/Api/GetLeads -k > LeadsReport.json