Solved

Missing attributes after REST API request

  • 30 November 2021
  • 1 reply
  • 17 views

Badge +2

At the moment I’m trying to read custom user attributes using the REST API.

https://api.revenuecat.com/v1/subscribers/XXXXXXXXXXXXX'

According to the following link this should be possible:

https://docs.revenuecat.com/docs/subscriber-attributes#reading-attributes

However; after a request I get the following data: without any attributes:

{
   "request_date":"2021-11-30T09":"16":09Z,
   "request_date_ms":1638263769288,
   "subscriber":{
      "entitlements":{
         "Pro":{
            "expires_date":"2021-12-25T12":"38":30Z,
            "grace_period_expires_date":null,
            "product_identifier":XXXXXXXXXXXX,
            "purchase_date":"2021-11-25T12":"38":30Z
         }
      },
      "first_seen":"2020-11-14T21":"10":39Z,
      "last_seen":"2021-11-29T15":"03":39Z,
      "management_url":null,
      "non_subscriptions":{
         
      },
      "original_app_user_id":XXXXXXXXXXXX,
      "original_application_version":1.0,
      "original_purchase_date":"2013-08-01T07":"00":00Z,
      "other_purchases":{
         
      },
      "subscriptions":{
         “XXXXXXXXXXXX":{
            "billing_issues_detected_at":null,
            "expires_date":"2021-12-25T12":"38":30Z,
            "grace_period_expires_date":null,
            "is_sandbox":false,
            "original_purchase_date":"2021-11-25T12":"38":30Z,
            "period_type":"normal",
            "purchase_date":"2021-11-25T12":"38":30Z,
            "store":"stripe",
            "unsubscribe_detected_at":null
         },
         “XXXXXXXXXXXX":{
            "billing_issues_detected_at":null,
            "expires_date":"2021-12-25T12":"04":12Z,
            "grace_period_expires_date":null,
            "is_sandbox":true,
            "original_purchase_date":"2021-11-25T12":"04":13Z,
            "period_type":"normal",
            "purchase_date":"2021-11-25T12":"04":13Z,
            "store":"stripe",
            "unsubscribe_detected_at":null
         },
         “XXXXXXXXXXXX":{
            "billing_issues_detected_at":null,
            "expires_date":"2020-10-17T14":"27":06Z,
            "grace_period_expires_date":null,
            "is_sandbox":true,
            "original_purchase_date":"2020-10-16T09":"12":19Z,
            "period_type":"normal",
            "purchase_date":"2020-10-17T13":"27":06Z,
            "store":"app_store",
            "unsubscribe_detected_at":null
         },
         “XXXXXXXXXXXX":{
            "billing_issues_detected_at":null,
            "expires_date":"2021-03-24T12":"12":21Z,
            "grace_period_expires_date":null,
            "is_sandbox":true,
            "original_purchase_date":"2020-10-16T09":"12":19Z,
            "period_type":"normal",
            "purchase_date":"2021-03-24T12":"07":21Z,
            "store":"app_store",
            "unsubscribe_detected_at":"2021-03-24T12":"30":13Z
         }
      }
   }
}

 

When opening the users’ account on the dashboard, the attribute does exist. I’ve triple checked I’m loading the right account and the attribute exists.

 

icon

Best answer by Albert-Jan 30 November 2021, 10:47

View original

1 reply

Badge +2

Solved! There is a different result depending on the key you send your request with. I made my request with a public key instead of a private one.

Reply