cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
CaMatt1
Level 3

REST api to get entitlements for a customer

Jump to solution

When I POST to /operations/entitlementOrders with body 

{
"batchSize": 100,
"pageNumber": 0
}

all I get is:

{ "statusInfo": { "status": "SUCCESS" } }

There's no data coming back from this endpoint. I get the same if I send a query to search for a particular customer eg:

{
   "queryParams": {
      "accountId": {
         "isSearchByName": true,
         "searchType": "STARTS_WITH",
         "value": "[Customer Name]"
        }
   }
}
 
I have replaced the actual customer name. 
 
Is this endpoint supposed to give back data? If I do the same query to the endpoint /operations/entitlementOrders/count I get a response of { "statusInfo": { "status": "SUCCESS" }, "count": 29 } So there are entitlements to list, they just don't get returned.
 
0 Kudos
(1) Solution
jberthold
Revenera Moderator Revenera Moderator
Revenera Moderator

Hi @CaMatt1 ,

A couple things ... First be sure to check out the Model for the /entitlementOrders REST Endpoint on the Swagger Page.  If  you are looking to use "STARTS_WITH" using a portion of the AccountId, the proper format is:

{
  "activatableItemSearchCriteria": {
      "accountId": {
        "searchType""STARTS_WITH",
        "value""ACME"
      }  
  },
  "batchSize"100,
  "pageNumber"1
}
 
Also, you have specified a batch size of 100 and have requested page Number 0, which does not have any results.  The first page with results is Page 1.  A snippet of the response using the call above in my instance:
 
{
    "statusInfo": {
        "status""SUCCESS"
    },
    "activatableItem": [
        {
            "activatableItemType""LINEITEM",
            "entitlementId""ACMESW-ENT-1130",
            "soldTo""ACME_Customer",
            "shipToEmail""",
            "shipToAddress""",
            "entitlementState""DEPLOYED",
            "activatableItemData": {
                "activationId": {
                    "id""3cff-ae31-74a6-47ee-98ce-0724-718b-338f"
                },    ...
 
Best regards,
Jim

View solution in original post

(2) Replies
jberthold
Revenera Moderator Revenera Moderator
Revenera Moderator

Hi @CaMatt1 ,

A couple things ... First be sure to check out the Model for the /entitlementOrders REST Endpoint on the Swagger Page.  If  you are looking to use "STARTS_WITH" using a portion of the AccountId, the proper format is:

{
  "activatableItemSearchCriteria": {
      "accountId": {
        "searchType""STARTS_WITH",
        "value""ACME"
      }  
  },
  "batchSize"100,
  "pageNumber"1
}
 
Also, you have specified a batch size of 100 and have requested page Number 0, which does not have any results.  The first page with results is Page 1.  A snippet of the response using the call above in my instance:
 
{
    "statusInfo": {
        "status""SUCCESS"
    },
    "activatableItem": [
        {
            "activatableItemType""LINEITEM",
            "entitlementId""ACMESW-ENT-1130",
            "soldTo""ACME_Customer",
            "shipToEmail""",
            "shipToAddress""",
            "entitlementState""DEPLOYED",
            "activatableItemData": {
                "activationId": {
                    "id""3cff-ae31-74a6-47ee-98ce-0724-718b-338f"
                },    ...
 
Best regards,
Jim

Thank you 

0 Kudos