# REST command line
**Category:** [Epicor ERP 10](https://www.epiusers.help/c/e10/5)
**Created:** 2016-11-14 16:11 UTC
**Views:** 3838
**Replies:** 4
**URL:** https://www.epiusers.help/t/rest-command-line/36266
---
## Post #1 by @Bart_Elia
I love my team. Start brainstorming something internally on a weekend and get another geek scratching their head and curious, start my morning and see the answer below waiting for me...
**_Thinking outside the box examples - No warranty - Hack - Don't yell at me or the company if it doesn't work_**
For background, review the REST Overview (https://epiusers.help/t/rest-overview-novel/36260)
cURL is a a utility for executing a URL via a command line and transferring data. It makes command line parameters for headers, etc. Spend some time at (https://curl.haxx.se/)
One example of the power of REST with BAQ and a CLI is below.
**_curl -X GET --header "Accept: application/atom+xml" "https://rm1016-pc0dd37y.americas.epicor.net/Erp10/api/v1/BaqSvc/zSalesOrderStatus/" -u manager:Epicor123_**
Let's break this down:
* curl is the open source utility mentioned.
* We are doing a GET so it's just a file download
* We are asking for xml format "Accept: application/atom+xml"
* The URL is the address from the help page:
*The username and password (oops, my secret identity is out!)
When executed from a command line you get the xml data returned
Now you can start directing responses to a file. How about trying old fashioned redirect:
**_curl -X GET --header "Accept: application/atom+xml" "https://rm1016-pc0dd37y.americas.epicor.net/Erp10/api/v1/BaqSvc/zSalesOrderStatus/" -u manager:Epicor123 >> output.txt_**
and you have a dump from the BAQ:
If you want to set it on a schedule to execute?
Spend some time learning the standard tools in the operating system - Windows Task Scheduler
---
## Post #2 by @John_Mitchell
Looks like a great place for an OAuth token instead of a username password :wink:
---
## Post #3 by @Bart_Elia
Have you looked at the current token implementation?
It's not quite Oauth as it was written before Oauth was ratified. The Legacy Activant folks used it and we added it to ICE to share authentication across the product lines.
The obvious next step is to span external products with open standards.
*No commitments provided, forward looking statement, I don't control product roadmap, don't yell at us or me if it does not happen, etc etc* I need to add this to some signature in here ;)
---
## Post #4 by @Kerry
sorry, not quite sure what you mean
---
## Post #5 by @Bart_Elia
Instead of hard coding usernames and passwords in conversation, user tokens and API tokens are commonly used to identify a client calling a server. OAuth is one style of authenticating and identifying users.
Somewhat readable overview.
(https://en.wikipedia.org/wiki/OAuth)
---
**Canonical:** https://www.epiusers.help/t/rest-command-line/36266
**Original content:** https://www.epiusers.help/t/rest-command-line/36266