SAP Knowledge Base Article - Public

3283103 - How to delete a job posting through OData API? - Recruiting Management

Symptom

How to delete a posting of a job requisition through OData API?

Environment

SAP SuccessFactors Recruiting Management

Resolution

To delete a job posting through OData API, please follow the steps below:

  1. In order to delete a job posting, it's important to know the jobPostingId (as each posting - internal, external, agency, private - has a unique ID for each entry. So it's required to know this value of the posting you wish to remove) and boardId to know if the jobPostingId refers to the internal, external, private postings or agency postings.

    E.g.:

    I wish to remove the external posting for the job requisition ID 2980. So, first I have to run the below query to get the jobPostingId, the boardId, and the postingStatus to confirm its status by filtering by the Job Requisition ID I wish to alter the job postings.

    https://api68sales.successfactors.com/odata/v2/JobRequisition?$select=jobReqId,jobReqPostings/jobPostingId,jobReqPostings/postingStatus,jobReqPostings/boardId&$expand=jobReqPostings&$format=JSON&$filter=jobReqId eq 2980

  2. The response from the above will provide us with the required information for step 3:

    "results": [
    {
    "__metadata": {
    "type": "SFOData.JobRequisition"
    },
    "jobReqId": "2980",
    "jobReqPostings": {
    "results": [
    {
    "__metadata": {
    "type": "SFOData.JobRequisitionPosting"
    },
    "jobPostingId": "1837",
    "postingStatus": "Success",
    "boardId": "_external"
    },
    {
    "__metadata": {
    "type": "SFOData.JobRequisitionPosting"
    },
    "jobPostingId": "1836",
    "postingStatus": "Updated",
    "boardId": "_internal"
    }
    ]
    ...

  3. With the above information, I know that the jobPostingId of the external posting is 1837. So, that is the value of the entry I wish to remove through ODATA.
  4. Then, it will be required to run a DELETE query using the following query:

    DELETE [API DATA CENTER URL]/odata/v2/JobRequisitionPosting(jobPostingId=[Job Posting ID]L, jobReqId=[Job Requisition ID]L)
    P.S.: Don't forget to include the L after the Job Posting ID and the Job Requisition ID as this is part of the payload.

    E.g.:
    I wish to delete the external job posting. So, it's required to run the above query using the DELETE operation:

    DELETE https://api68sales.successfactors.com/odata/v2/JobRequisitionPosting(jobPostingId=1837L,jobReqId=2980L)

  5. After running the query, the payload response will be empty, nothing will come up on the screen, but it was executed
  6. Run the GET query again to confirm, and you will see that the postingStatus will be "Deleted":
    ...
    "jobPostingId": "1837",
    "postingStatus": "Deleted",
    "boardId": "_external"
    }

Keywords

job, posting, api, requisition, JobRequisitionPosting, jobreqpostings, odata, integration, center, centre, internal, external, agency, delete, unpost , KBA , LOD-SF-RCM-API , Webservices & APIs , How To

Product

SAP SuccessFactors Recruiting all versions