question

Upvotes
Accepted
1 0 0 0

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?

Thank you

Regards

C.Nouri

tick-history-rest-apiusage
1610387691497.png (21.3 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
Accepted
23k 22 9 14

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:

Is my understanding of the question correct?


quota3.gif (68.4 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
23k 22 9 14

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.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
1 0 0 0

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

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
23k 22 9 14

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?



icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
1 0 0 0

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


1610571896804.png (6.6 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
23k 22 9 14

Hello @Chama,

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

And the same information as accessible via API:

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?


quota1.gif (50.6 KiB)
quota2.gif (20.4 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
1 0 0 0

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?



1610631235219.png (63.8 KiB)
1610631392904.png (63.6 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
1 0 0 0

Hi,

Thank you for your help!.

Your response the solution solved the problem.

Best regards

Chama Nouri

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea