Build the first application service
The first tool answers “How many vacation hours do I have left?”. Its API is a GET operation
that returns the signed-in user’s absence balances. Building it proves every link in the chain:
tokens, PeopleSoft security, the Application Services Framework (ASF), and the tool catalog.
Plan it
Section titled “Plan it”| Decision | For this service |
|---|---|
| Service | ZZ_ASSISTANT_HR, which will hold all of the Assistant’s HR tools |
| Resource | The root resource absence, with the URI template balances, and a GET method |
| Input | An optional plan, such as Vacation. No employee ID: the token identifies the user |
| Output | The user’s balances, and a link to the page with the details |
| Security | The permission list ZZ_ASSIST_USER, which every Assistant user gets |
| Authentication | OAuth 2.0, required |
Write the application class
Section titled “Write the application class”The Application Services Framework calls an application class for each request. The class extends
PTCBAPPLSVCDEFN:ApplicationServiceBase and implements its invokeService() method, which reads
the request’s inputs through %This.ServiceAPI and sets the method’s output parameters. Oracle’s
Plan and Create Application Class
tutorial shows the exact code for your PeopleTools release.
For this service, the method does three things:
-
Finds the user’s employee ID with
%EmployeeId, the employee ID on the signed-in user’s profile. It never takes an employee ID from the request, so users can only ever see their own balances. -
Reads the balances through a view, such as
ZZ_ABS_BAL_VW, that you build over your absence tables, so the service doesn’t depend on how your absence setup stores them:The balances query, with %EmployeeId bound to :1 SELECT PLAN_DESCR, BALANCE_HOURS, AS_OF_DATEFROM PS_ZZ_ABS_BAL_VWWHERE EMPLID = :1ORDER BY PLAN_DESCR -
Builds the page link with
GenerateComponentContentURL, and returns the balances and the link as the method’s output:The output {"balances": [{ "plan": "Vacation", "hours": 46.5, "asOf": "2026-09-24" },{ "plan": "Sick", "hours": 30, "asOf": "2026-09-24" }],"page": {"label": "Absence Balances","url": "https://hr.example.com/psc/ps/EMPLOYEE/HRMS/c/ZZ_ABSENCE.ZZ_ABS_BAL_FL.GBL"}}
Create the application service
Section titled “Create the application service”-
Create the service. At PeopleTools > Integration Broker > Application Services > Manage Application Services, choose Create Application Service, and name it
ZZ_ASSISTANT_HR. -
Add the root resource
absence, with the Create Root Resource button. -
Add the URI template
balances. Templates with values in braces, such as{requisitionId}, also need those values defined as base template parameters; this one has none. -
Add the
GETmethod to the template, with your application class as its handler, the optional input parameterplan, and the output parameters. -
Grant access. Give the permission list
ZZ_ASSIST_USERaccess to the service, or to the root resource. -
Require OAuth 2.0 as the method’s authentication, so it accepts the tokens you set up in Connect sign-in.
-
Activate the service. ASF then generates its OpenAPI description.
Download the OpenAPI description, and save it as specs/zz_assistant_hr.json for the
tool catalog.
Test it
Section titled “Test it”Call the operation with a test user’s token, using the operation’s URL from the OpenAPI description:
curl -s -H "Authorization: Bearer $TOKEN" "$BALANCES_URL" | jq .You should get the test user’s balances, in the format above. Then check that PeopleSoft refuses what it should:
- No token: the request is refused.
- A user without
ZZ_ASSIST_USER: the request is refused, even with a valid token. - Two different users: each gets only their own balances.
