Hi, I need help regarding with Oauth API, I'm struggling on how to implement in PHPR10.7 .
here are the details:
Two API given, one for authorization and other is to get the records.
1. First API is to get the authorization. (I assume this is the REST API Connection part)
Method: POST
URL: https://test.sample.com/oAuth2Server/rest/oauth/RequestToken
Client ID: 85b450f0-3a2f-6e4a-a862-b4cab9ed8308
Client Secret: 63525EB2BECE9B4B03EE5D7BDC99CB3CA39FA3CBE7EF55B3D8BC9565DA0BBB4A
Body Grant Type: "client_credentials"
Expected Response:
{
"access_token": "ADF96F88D1193A65D599E8FB62CC1547DC73026E5E65B7FCE77A98FCCAD87432",
"refresh_token": "b838b73a-d9f6-6745-92c3-871d438f2af2",
"token_type": "bearer",
"expires": 3600,
"error": {
"error": "",
"isSuccess": true
}
}
2. The second API is to get records by to input a WONumber to search. (I assume this is the Create REST View part)
Method: POST
URL: https://test.sample.com/oAuth2Server/Service/rest/WFM_API/GetRecords
Header: token (a generated token from authorization response)
Body :
{
"WONumber": "string"
}
Expected Response:
{
"WONumber": "125136959",
"WOStatus": "Completed",
"AppointmentDate": "2022-02-09 00:00:00 AM",
"CustomerName": "WFHtest1, WFHtest1",
"ContactNumber": "349271053337",
"CustomerAddress": "Second District G661 /Test City",
"ServiceId": "1202301395",
"TechnicianAssignee": "JAMES John",
"Contractor": "JASSY 12345678901234567890",
"responseCode": "200",
"ResponseMessage": "Successfully Retrieved"
}
Advance thanks to those who can guide me...