Quota Usage Details TRTH V2 by User (not global)

Hi,

I would like to know if there is an End point that I can use to get the data usage Quota by user.

I have found GetQuotainformation but I need to have one that will give result by User and not a global figure.

can you, please, share how can we do that?

image

Thank you

Regards

C.Nouri

Best Answer

  • Hello @Chama,

    Thanks for this explanation.

    I undertsand that you are saying that the GUI filters the returned Quota results for you when you search, using AuthorizationUserId as criteria?

    As you receive the complete results via GetAuthorizedRicList(CategoryCode='2017-06') call via API request, to obtain the same filtered programmatically, you will need to filter the result set in your code.

    In your programming language of choice, would absorb the returned result into a JSON object, iterate over the entries, and present as result only the ones with AuthorizationUserId id.

    Any other manipulation of the returned result set can also be performed, per your requirement.

    For example, to filter out in Postman script, I would do:

    var jsonData = JSON.parse(responseBody);
    for (key in jsonData.value) {
        if( jsonData.value[key].AuthorizationUserId == "227124")   
            console.log( jsonData.value[key].AuthorizedValue + '; ' + jsonData.value[key].AuthorizationDate +' ; ' + jsonData.value[key].AuthorizationUserId)
    }

    For me the filtered result is logged to console:

    image

    Is my understanding of the question correct?

Answers

  • Hello @Chama,

    {{protocol}}{{host}}{{api}}/Quota/GetQuotaInformation request returns quota for the specific user, the user that is authenticated and is submitting the request.

    The result to this call correspond to the information you can retrieve via DSS GUI, by selecting from the main menu

    Your User -> Tick History Quota

    If I understand your intention correctly, the Quota information can not be requested on behalf of another user.

  • Hello Zoya,

    in TRTH Usage Quota when you select a month you can see that the global number does not correspond to your user but a group of user. That's why I have added a screenshot. The report contains a Global Quota. How can we have individual Quota? and not the global Quota?

    Regards

    Chama Nouri

  • Hello @Chama,

    Thanks, I think I now understand the question better.

    When you run

    {{protocol}}{{host}}{{api}}/Quota/GetQuotaInformation 

    You get back category codes such as

    ...
    {
        "@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#Collection(ThomsonReuters.Dss.Api.Quota.Quota)",
        "value": [
            {
                "Count": 10,
                "Category": {
                    "Code": "2017-06",
                    "Name": "June 2017 Compliance Quota"
                }
            },

    Next, you can use the category codes to derive the details on them:

    {{protocol}}{{host}}{{api}}/Quota//GetAuthorizedRicList(CategoryCode='2017-06') 

    This should bring back the same info you would obtain by selecting/expanding a month.

    Is this what you are looking for?



  • Hi Zoya,

    yes you are right I have got the response you displayed. but in the file you can see all RIC per User and I just need a count.

    Today I am doing it manually to get the result like that.(cf screenshot below)

    I run it everyday manually and I wanted to have a query to get by user ID - which are available in Quota - the count of Instruments. Does that make sense?

    Let me know if you need more details,

    Regards

    Chama

    image

  • Hello @Chama,

    I think you are saying that Quota per month as displayed in DSS GUI

    image

    And the same information as accessible via API:

    image

    Is not what you are looking for?

    There is no additional quota info that is available via API that is not available via DSS GUI.

    In my understanding of the requirement, you could send the requests with category codes every day programmatically

    {{protocol}}{{host}}{{api}}/Quota//GetAuthorizedRicList(CategoryCode='2017-06') 

    and optionally aggregate or process the results (above) programmatically, per your requirement, same way as you do now manually.

    These two are the only quota requests that are exposed per DSS API Reference

    Does this help?

  • Hi Zoya,

    you go on Usage , then you select a month example january 2021.

    then click on it and you will see the list of instrument by User.

    what I want is to have bu user when you have several user.

    the QuotaInformation gives us the global number cf screenshot 1 below with number highlighted.

    Then in the search bar you can put the User id you are looking for then you will see the number changing cf screenshot 2 below.

    is that clear?

    image


    image

  • Hi,

    Thank you for your help!.

    Your response the solution solved the problem.

    Best regards

    Chama Nouri