Hi All,

I configured the subscription creation workflow and tested it with the
current implementation of the REST API.

When we add a subscription in normal scenario we get the following response.

*Request*:

POST http://127.0.0.1:9764/api/am/store/v1//subscriptions HTTP/1.1

{
      "tier": "Silver",
      "apiId": "2f4a020b-2a0d-4a47-b385-a22a93577082",
      "applicationId": "69041195-1e81-48f5-8892-2ab053b0501c",
}


*Response:*

HTTP/1.1 *201* Created

Location: http://127.0.0.1:9764/api/am/store/v1/subscriptions/
63ab53d3-0cb7-46df-8ce9-cd84f2882b27
Content-Type: application/json


{
      "tier": "Silver",
      "subscriptionId": "63ab53d3-0cb7-46df-8ce9-cd84f2882b27",
      "apiId": "2f4a020b-2a0d-4a47-b385-a22a93577082",
      "applicationId": "69041195-1e81-48f5-8892-2ab053b0501c",
      *"status": "UNBLOCKED"*
}


When we have a subscription creation workflow enabled, we receive a
response like follow.

HTTP/1.1 *201* Created

Location: http://127.0.0.1:9764/api/am/store/v1/subscriptions/
def79733-e55e-464f-9630-c1ae595344f2
Content-Type: application/json

{
   "subscriptionId": "def79733-e55e-464f-9630-c1ae595344f2",
   "apiId": "admin-pubApi-1.0",
   "tier": "Silver",
   "applicationId": "69041195-1e81-48f5-8892-2ab053b0501c",
   *"status": "ON_HOLD"*
}


Here we can see that the status is ON_HOLD. In this case we can also see
some more information that are coming from APIM underline implementation,
which are follows:

   - redirectUrl : "http://google.lk";
   - displayUrl : "http://wso2.com";
   - workflowRefId : "0b94b11a-2736-48a0-b43e-c7cc35d8516d"
   - CallbackUrl : http://google.lk


Do we need to include this info in the response object? If so what would be
the best approach?

Few ways that are possible include:

   - Add those additional information into the response object
   - Add this redirect URL as HTTP 302 redirection as the Location header

Please share your thoughts.

Thank you,
Malintha

-- 
Malintha Amarasinghe
Software Engineer
*WSO2, Inc. - lean | enterprise | middleware*
http://wso2.com/

Mobile : +94 712383306
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to