I am building an Asynchronous API with polling and it has the following endpoints -
- POST Create Resource
Request -
curl -X POST https://api.example.com/v1/card/eligibility/
Response -
{
"requestId": "12345678",
"timestamp": "2021-11-01",
...
}
- GET Fetch Resource - we can use it for polling top
Request -
curl -X GET https://api.example.com/v1/card/eligibility/12345678
Response -
{
eligibilityStatus: Eligible/Ineligible
orderData: abc
..
}
Can I expose a separate GET endpoint working on the same requestId to run a function over the same resource?
3rd endpoint
Request -
curl -X GET https://api.example.com/v1/card/product-eligibility/12345678
Response -
{
product-eligibility: 111
orderData: abc
..
}