Test the service
Using PowerShell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
Using Postman
Create a collection
- Open Postman.
- In the top left corner, click on the 3 lines-icon, click on File and the New.
- Click on Collection.
- Give the collection a name like "EPR-Test".
- Just below the name you gave the collection you should have "Authorization", click on it to ensure it is the active tab.
- Set Basic Auth as Type and enter the credentials to your instance of EPR.
- Click on Save or use CTRL+S.
- Click on "Variables".
- Enter a new variable with the name url, initial value and default value should be the "base url" to EPR. It could be http://eprserver.domain.com/api or http://localhost:8089/api.
- Click on Save or use CTRL+S.
Create a ping request
- Hover over the collection in the left pane, and click on the 3 dots at appear.
- Click on Add request.
- Name the request "Ping".
- Enter the following where is says "Enter request URL": {{url}}/ping
- Click on Save, or use CTRL+S, and then click Send.
- You should get a response in the lower pane looking some this:
1 2 3
{ "message": "Pong!" }
Create a POST request
- Hover over the collection in the left pane, and click on the 3 dots at appear.
- Click on Add request.
- Name the request "Test the service".
- Enter the following where is says "Enter request URL": {{url}}/script
- Click on the tab "Body" just under the URL field and paste the JSON example below.
1 2 3
{ "importHandlerIdentifier": "testService.ps1" }
- Click on Save, or use CTRL+S, and then click Send.
- You should get a response in the lower pane looking some this:
1 2 3 4 5 6 7
{ "importItemResult": [ { "result": "OK" } ] }
When you have done that you should have a file called StringInput.txt in [EPRInstallRoot]/scripts with a timestamp and the json example above.
Using GO
- Configure an export configuration.
- Configure an item event handler with the function 'Export item' and "point" it to http://localhost:8085/api/script.
- Put testService.ps1 as identifier in the function configuration.
- Make the event handler execute, wait for the minute to pass, and you should have a file called StringInput.txt in [EPRInstallRoot]/scripts with the exported item from GO.