on 06-08-2020 2:16 PM
I have created CAP project and deploy it to SCP CF environment with the model and service definition below
I tried to test my backend service API on post man . I create new entity using post request it works as shown below but when I use get request i don't find any entity from those I have created with post method
HI Mariam Id-Manssour,
My self-Prashanth I also facing a similar issue that you have faced was able to POST the data in the POSTMAN and the log of the created entry is not getting reflected in the GET Request of POSTMAN.
please let me know if you have solved this issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You need to provide a UUID value, that means you need to skip the quotes:
/MaintenanceRequests(ID=a33175c2-4e08-4a5a-93e4-6de98c7b83a5,IsActiveEntity=false)
Best regards,
David
Hi Mariam,
I think you could benefit from running this "locally". Business Application Studio allows you to test your service without deploying it first to CF. You can use a local db, or test with SAP HANA, and to send requests you can use an integrated rest client.
See more details here: https://cap.cloud.sap/docs/get-started/in-bastudio
Thanks,
Liat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mariam,
did you specify the UUID generated from your first post request in the second one as ID. Instead of 'generated UUID' you have to type the real UUID
Could you attach a screenshot of your post request?
Best Regards
Maria
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi mariya.yordanova
I am having a similar issue currently - is it not possible to make PATCH/POST/PUT directly on active Entities?
see here:
https://answers.sap.com/questions/13320281/patch-call-is-returning-401-for-cap-service.html
I would be very grateful if you could take a look:)
Best Regards
Hi mariya.yordanova,
We have tried the same approach as suggested by you, i.e. we have used the UUID generated from the first POST request to the second POST request as shown below:
Where a33175c2-4e08-4a5a-93e4-6de98c7b83a5 is generated UUID from the first POST request.
But we still get the same error:
{ "error": { "code": "400", "message": "No 'Edm.Guid' value found for key 'ID'" }}Regards,Sangita
Hi Mariam,
as I see the entity Offers is draft enabled. Your post request creates an entity in a draft table, the created entity is not activated. The get request reads all activated entites. You have to activate this entity in order to see the data by get. So please make a POST /Offers(ID='generated UUID',IsActiveEntity=false)/service.draft.draftActivate`.
Best Regards
Maria
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi mariya.yordanova ,
How can I activate the entity to see the data by get ? can I perform CRUD operation on offer entity without enabling draft ?
I tried to call the request : POST /Offers(ID='generated UUID',IsActiveEntity=false)/service.draft.draftActivate` and i get this response
{
"error": {
"code": "null",
"message": "No 'Edm.Guid' value found for key 'ID'"
}
}
Thank you
Mariam
User | Count |
---|---|
84 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.