"Number of user subscription exceed the limit" error: news-stories-subscriptions endpoint

AbiM77
AbiM77 Newcomer
edited April 29 in Refinitiv Data Platform

Hi,

I am attempting to connect to the https://api.refinitiv.com/alerts/v1/news-stories-subscriptions via a Python script on my local machine. When doing a POST request to this, I keep hitting the following error: {"error":{"id":"3aa593ff-7498-4dbc-8aca-b3882f556d0a","code":"30016","status":"422","message":"Number of user subscription exceed the limit"}}. Note that I have deleted all existing subscriptions in the API Playground and also tried sending a 'DELETE' request to the same endpoint as explained in this article

When running the DELETE request, I get the following response in API Playground:

image.png

And this is the error in my IDE (VSCode):

image.png

For context, I've also attached a relevant snippet of the code:

image.png

Any help would be appreciated

Answers

  • Hello @AbiM77

    You are not deleting the subscription properly. I would refer you to the Python samples for Data Platform - specifically newsMessages.py to see how the subscribe and delete are implemented.

    Begin by getting a list of all open active subscriptions (-l switch in the sample).

    if currentSubscriptionID:
      print("Deleting the open subscription")
      dResp = requests.delete(RESOURCE_ENDPOINT, headers = {"Authorization": "Bearer " + accessToken}, params = {"subscriptionID": currentSubscriptionID})
    else:
      print("Deleting ALL open headline and stories subscription")
      dResp = requests.delete(RESOURCE_ENDPOINT, headers = {"Authorization": "Bearer " + accessToken})