Before You Begin
This 15 minute tutorial shows you how to setup postman which is used throughout this training to make rest calls.
Background
This tutorial uses the Postman application to interact with the Workers API.
What Do You Need?
- Postman App or another client.
- HCM Cloud user account information.
Add an Environment
The samples provided use a URL token. Setting an environment variable allows postman to replace the token with the environment string. This step is optional. You may manually replace the token with your environment details.
- Click Manage Environments.
Name the environment Oracle Test Env.
-
Give the environment the following variables:
Note: The Initial Value must come from your environment.
Attribute Value Variable url Initial Value https://environment.us.oracle.com/ Variable User Initial Value Integration_User01 Variable Password Initial Value Password123 - Click Add.
Create a New Collection
Create a collection.
- On the Description tab, name the collection ##_UserAccountsCollection.
- On the Authorization tab, set type as Basic Auth, and set the credentials to {{User}} and {{Password}}
In the Pre-request Scripts tab, enter the following code:
var moment = require('moment'); pm.globals.set("dateStamp", moment().format("YYYY-MM-DD")); pm.globals.set("5DaysAgo", moment().add('days', -5).format("YYYY-MM-DD")); pm.globals.set("4DaysAhead", moment().add('days', 4).format("YYYY-MM-DD")); pm.globals.set("5DaysAhead", moment().add('days', 5).format("YYYY-MM-DD")); pm.globals.set ("endDate" , '4712-12-31');
This code snippit will generate dynamic dates that can be used in your request.
- Click Create.