Goal : Use ADP Decidium REST API with your Magic xpi Platform
Prerequisites :
- ADP Certificate (crt file) with a Key file
- Client id and Client secret
- openssl
1/ Check with Postman that your API is working
Define in the postman settings, 2 endpoints (accounts.eu.adp.com and api.eu.adp.com) with the same crt and key files

Navigate to Workers – Lifecycle Management in other the get information from the Decidium Rest API lifecycle Management

Scroll down, we will focus on the /events/hr/v1/worker.hire endpoint

Do a POST to Retrieve the OAuth2 token from this endpoint https://api.eu.adp.com/auth/oauth/v2/token

Do a POST on this endpoint https://api.eu.adp.com/events/hr/v1/worker.hire (for hiring a worker)

A Json body example can be found in the documentation.

2/ In other to use the API in Magic xpi, you have to convert your crt file in jks or p12/pfx format
You can use this command line example below to generate the p12 format or jks format
openssl pkcs12 -export -in ADP_Decidium.cer -inkey ADP_Decidium.key -out client.p12 -name client-cert -password pass:<yourpassword1>
keytool -importkeystore -srckeystore client.p12 -srcstoretype PKCS12 -srcstorepass <yourpassword1> -destkeystore client.jks -deststoretype JKS -deststorepass <yourpassword2>
Open your Magic xpi resources repository and define a REST Client resource like below

For /auth/oauth/v2/token ,the Content-Type header must be set to : application/x-www-form-urlencoded
For all other paths, Content-Type header must be set to : application/json and you must add Authorization with value : Bearer 1234

3/ Create a first step in your flow to set the Token body

4/ create a second step to call the Token API and pass your Body variable (C.BodyRequest) in the DataBlob mapping

5/ Use a flow data step to retrieve the access token

6/ In this example, we want to fill the ADP Json body from a workday payload
You will need the Workday XML schema and the ADP JSON schema

7/ Add a REST Client Step to execute worker hire endpoint

After pressing OK, Set the Datablob with your previous body variable (C.BodyRequest)
Don’t forget to set the Access token in the Authorization header
8/ If your call is successfull (Http 200 status code), you can retrieve the worker id or associateOID by parsing the json response.

(*) ADP Documentation : ADP Developer Resources