Iâm trying to compose an OData batch to retrieve a set of results from table PAYMENT using request_id for the retrieval. From the returned results I want to extract the payment_id and add this to the URL for the delete as payment_id is the only allowed unique key in the delete URL.
I have the below OData batch:
âbatch_ABC Content-Type: multipart/mixed; boundary=changesetPQR
âchangesetPQR Content-Type: application/http Content-Transfer-Encoding: binary Content-ID: 1
GET https://XXXX-dev.corporate.ifs.com/FSMDEV/odata/payment?$filter=request_id eq â991â HTTP/1.1 Content-Type: application/json
âchangesetPQR Content-Type: application/http Content-Transfer-Encoding: binary Content-ID: 2
DELETE https://XXXX-dev.corporate.ifs.com/FSMDEV/odata/payment?$filter=request_id eq â991â HTTP/1.1 Content-Type: application/json
âchangesetPQR-- --batch_ABCâ
Below are the results:
âbatchresponse_fdffc443-4f7c-4be7-bbb6-4804476baa4d Content-Type: application/http Content-Transfer-Encoding: binary
HTTP/1.1 200 OK Content-Type: application/json; odata.metadata=minimal OData-Version: 4.0
{â@odata.contextâ:âhttps://XXXX-dev.corporate.ifs.com/FSMDEV/OData/$metadata#PAYMENT",âvalueâ:[{âcreated_byâ:âMETRIXâ,âcreated_dttmâ:â2023-07-14T17:55:25.9100000â,âmemoâ:"INTEGRATION TESTâ,âmodified_byâ:âMETRIXâ,âmodified_dttmâ:â2023-07-14T17:55:25.9100000â,âpayment_amountâ:â200.00â,âpayment_card_cvv_maskâ:â999â,âpayment_card_expiredâ:â12/2024â,âpayment_card_holderâ:âJoe Bloggsâ,âpayment_card_no_maskâ:â1234 5678 9101 1121â,âpayment_card_typeâ:âVISAâ,âpayment_currencyâ:âTRYâ,âpayment_idâ:15,âpayment_methodâ:âCRDCâ,âpayment_refâ:âINTEGRATIONâ,âpayment_statusâ:âINTâ,âplace_idâ:â311â,ârequest_idâ:â991â}]} --batchresponse_fdffc443-4f7c-4be7-bbb6-4804476baa4d Content-Type: application/http Content-Transfer-Encoding: binary
HTTP/1.1 404 Not Found Content-Type: application/json; odata.metadata=minimal OData-Version: 4.0
{âerrorâ:{âcodeâ:ââ,âmessageâ:âNo HTTP resource was found that matches the request URI âhttps://XXXX-dev.corporate.ifs.com/FSMDEV/odata/payment?$filter=request_id eq â991ââ.â}} --batchresponse_fdffc443-4f7c-4be7-bbb6-4804476baa4dâ
Is the above possible?
Thank you in advance for any assistance.
I have played around a little bit with XPath as well but have been unsuccessful thus far, though it may just be my syntax that is out. Iâm also looking into maybe using a different changeset, but I canât quite join everything together.