Why am I getting a header error when accessing version 1.4 of the REST API?
Environment:
Oracle B2C Service
Versions August 2017 and newer
Issue:
I am receiving the following error when performing a REST API version 1.4 request:
{"type":"https://sitename.custhelp.com/services/rest/connect/exceptions/OSC-CREST-00025","title":"Bad Request","status":400,"detail":"Request does not contain OSvC-CREST-Application-Context header","instance":"https://sitename.custhelp.com/services/rest/connect/v1.4/accounts/1","o:errorCode":"OSC-CREST-00025"}
Resolution:
The cause is the required header OSvC-CREST-Application-Context is not being used, which is mandatory in version 1.4. You can still use version 1.3 without using this header though.
To resolve the issue in SoapUI, follow the steps below:
1. Download SoapUI, install it and launch it
2. Create a new REST project
3. Enter the URI you need to access (e.g. https://sitename.custhelp.com/services/rest/connect/v1.4/accounts/1)
4. Enter Basic Authentication credentials after clicking Auth in the lower left
5. Perform a request. Notice you get the header error above.
6. Add the following header in the "Headers" section of the request:
- header: OSvC-CREST-Application-Context
- value: This is a valid request for account.
7. Perform the request again
8. Notice you are not receiving the header error anymore
Additional information on using headers in the REST API can be found in the REST API documentation:
Answer ID 5169: Technical Documentation and Sample Code