Search for:
REST API Error – ┬áThe specified operation is not supported for the invoked HTTP method

Many a times while trying to use Post method using REST API, we encounter – ”┬áThe specified operation is not supported for the invoked HTTP method. Please check the URL and the headers.”

Cause of this error is incorrect header parameters/ missing header parameters while making a call to REST API.

To fix the issue:

  1. Open Postman
  2. Under Headers:

3. Set below values:

Key – Content-type

Value – application/vnd.oracle.adf.action+json

Once the header values are set, the error will go away:

REST API – Sample Payloads (Part – 1)

Sample payload for adding DFF attribute value for absence entries:

  1. Sample Rest API Payload for adding dff value

url will be same :

https://abc_test.oraclecloud.com/hcmRestApi/resources/11.13.18.02/absences/

{

    “personNumber”: “999”,

    “employer”: “ABC Test Employer“,

    “absenceType”: “Sick Leave”,

    “startDateDuration”: “1”,

    “startDate”: “2019-03-28”,

    “startTime”: “08:00”,

    “endDate”: “2019-03-28”,

    “endTime”: “17:00”,

    “absenceStatusCd”: “SUBMITTED”,

    “diseaseCode”:”https://google.com”,

    “absenceRecordingDFF”: [

        {

            “__FLEX_Context”: null,

            “preapprovaltaken”: “N”

        }

    ]

}

In above example dff preapprovaltaken is enabled at global level and not at any context.

Below is another example where context is enabled

{

                “personNumber”: “999”,

                “employer”: ” ABC Test Employer “,

                “absenceType”: “Maternity Leave”,

                “startDateDuration”:”1″,

                “startDate”: “2019-10-08”,

                “startTime”: “08:00”,

                “endDate”: “2019-10-08”,

                “endTime”: “17:00”,

                “absenceStatusCd”: “SUBMITTED”,

                “absenceReason”:”ML – For Adoption”,

                “absenceRecordingDFF”: [{

                                                “administratorComments” : null,

                                               “__FLEX_Context” : “300000089749943”,

                                              “dateOfAdoption” : “2019-10-22”

                                               }

                                         ]

}

This context value can be retrieved from below query:

SELECT DESCRIPTIVE_FLEX_CONTEXT_CODE
FROM fnd_descr_flex_contexts_vl
WHERE UPPER(DESCRIPTIVE_FLEXFIELD_NAME) LIKE ‘ANC_PER_ABS_ENTRIES_DFF’