Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Jira Legacy
serverSystem Jira
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId01505d01-b853-3c2e-90f1-ee9b165564fc
keyMODKBEKBJ-489

Jira Legacy
serverSystem Jira
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId01505d01-b853-3c2e-90f1-ee9b165564fc
keyMODKBEKBJ-484

...

This method of getting APIGEE token is the same for all endpoints of cost-per-use controller.


Expand

POST https://apis.ebsco.com/oauth-proxy/token

Sample Request - 

Code Block
curl --location --request POST 'https://apis.ebsco.com/oauth-proxy/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id=XXXX' \
--data-urlencode 'client_secret=XXXX'


Sample Response - 

Code Block
{
    "access_token": "XXXX",
    "token_type": "Bearer",
    "expires_in": 3600,
    "scope": "openid"
}


...

Expand

Mockup - https://drive.google.com/file/d/1oWvhXBeE58KEoxkiaWYsBsKI6LqK8oaB/view?usp=sharing

POST https://apis.ebsco.com/uc/costperuse/titles

Sample request - 

Code Block
curl --location --request POST 'https://apis.ebsco.com/uc/costperuse/titles?fiscalYear=2019&fiscalMonth=Jul&analysisCurrency=AUD&publisherPlatform=true&previousYear=true' \
--header 'custkey: XXXX' \
--header 'Authorization: Bearer XXXX' \
--header 'Content-Type: application/json' \
--data-raw '[
  {
    "kbid": 356, --> title id
    "listId": 473 --> package id
  },
  {
    "kbid": 491,
    "listId": 473
  }
]'

Sample response - 

Code Block
{
    "356.473": {
        "current": {
            "cost": 141.8806,
            "usage": 26,
            "costPerUse": 5.456946153846153
        },
        "previous": {
            "usage": 52
        }
    },
    "491.473": {
        "current": {
            "cost": 100.0,
            "usage": 15,
            "costPerUse": 6.666666666666667
        },
        "previous": {
            "cost": 83.343325,
            "usage": 74,
            "costPerUse": 1.1262611486486485
        }
    }
}

Details needed by mockup:

  1. List of selected titles that belong to a package - UI already has a way to get the list of titles associated with a package
  2. Get the list of titles from 1. and make a request to the endpoint above passing in currency and publisher platform - publisherPlatform can be "publisher" , "non-publisher" or "All"
  3. Title - Name of resource - we will not get this from cost-per-use api - we'll have to use existing HoldingsIQ endpoint for this and we already populate it in UI
  4. Type - Publication type of resource - we will not get this from cost-per-use api - we'll have to use existing HoldingsIQ endpoint for this and we already populate it in UI
  5. Cost - <titleid.packageid>.current.cost
  6. Usage - <titleid.packageid>.current.usage
    1. If 'publisherPlatform' = true - we'll pass the query param 'publisherPlatform' = true
    2. If 'publisherPlatform' = false - we'll pass the query param 'publisherPlatform' = false
    3. If 'publisherPlatform' = ALL - we'll have to make 2 requests with 'publisherPlatform' = true and 'publisherPlatform' = false and sum up individual package-titles usage -
      for example: <titleid.packageid>.current.usage when 'publisherPlatform' = true and 'publisherPlatform' = false
  7. Cost Per Use - <titleid.packageid>.current.costPerUse
    1. If 'publisherPlatform' = true - we'll pass the query param 'publisherPlatform' = true and extract <titleid.packageid>.current.costPerUse
    2. If 'publisherPlatform' = false - we'll pass the query param 'publisherPlatform' = false and extract <titleid.packageid>.current.costPerUse
    3. If 'publisherPlatform' = ALL - 5.(Cost)/6.(Usage) - Note that we could use this same formula for a. and b. above instead of using costPerUse info that we get from response
  8. % of usage - looks like (Usage returned in 6. above divided by Platform(s) usage(2.4 in previous block)) * 100 - Khalilah to clarify with kimie [ Sobha DuvvuriKG: % of usage represents percentage of usage for the title in the package across all selected titles in a package usage OR total package usage for the selected fiscal year/filter platform selection. We will revise the mockup to align.] - Update: After kimie revised the mockups, the formula used is correct - % of usage = (Usage returned in 6. above divided by Platform(s) usage(2.4 in previous block)) * 100 and the percentage is rounded to the nearest integer.


...

Expand

Mockup: https://drive.google.com/file/d/1ttgxYvr7bzRYf47DaGU4vgWn0EkbwZ1f/view?usp=sharing

Endpoint: GET https://apis.ebsco.com/uc/costperuse/title/<titleId>/<packageId>

Sample Request:

Code Block
curl --location --request GET 'https://apis.ebsco.com/uc/costperuse/title/356/473?fiscalYear=2019&fiscalMonth=Jul&analysisCurrency=AUD&aggregatedFullText=false' \
--header 'custkey: <encrypted cust id>' \
--header 'Authorization: Bearer <auth token>'

Sample Response:

Code Block
{
    "usage": {
        "platforms": {
            "Wiley Online Library": {
                "counts": [
                    0,
                    1,
                    3,
                    1,
                    3,
                    1,
                    16,
                    1,
                    null,
                    null,
                    null,
                    null
                ],
                "publisherPlatform": true
            },
            "EBSCOhost": {
                "counts": [
                    2,
                    null,
                    1,
                    null,
                    null,
                    null,
                    3,
                    4,
                    null,
                    null,
                    null,
                    null
                ],
                "publisherPlatform": false
            }
        }
    },
    "analysis": {
        "current": {
            "cost": 141.8806,
            "usage": 26,
            "costPerUse": 5.456946153846153
        },
        "previous": {
            "usage": 52
        }
    }
}


Details needed by mockup:

  1. Fiscal Year - Will be selected in drop-down and passed to backend - this can be passed to api

  2. Publisher Platform Dropdown Values - Publisher, Non-Publisher, ALL - Khalilah to decide whether this will be in Settings → eHoldings → Usage Consolidation → PublisherPlatform or package-title level or both where package-title level setting overrides the Settings level selection  [ Sobha DuvvuriKG: There will be a Default Platform display setting: values will be Publisher Platform only, Non-Publisher Platform only, All. Default selection will be All. When a user is on a package/title-package/title record, s/he can override the default setting with the Filter by platforms - filter.]

  3. Publisher Platform(s) - List returned by API response in this endpoint above. 

    Based on selected value for PublisherPlatform,

    if Publisher - we extract usage.platforms.<keys> where publisherPlatform = true

    if Non-Publisher - we extract usage.platforms.<keys> where publisherPlatform = false

    if ALL is selected - we extract usage.platforms.<keys> where publisherPlatform = true/false

  4. Cost - analysis.current.cost
  5. Platform(s) usage - analysis.current.usage
    1. if Publisher - we extract analysis.current.usage by passing query parameter 'aggregatedFullText' = false

    2. if Non-Publisher - we extract analysis.current.usage by passing query parameter 'aggregatedFullText' = true

    3. if ALL is selected - we make 2 requests - one by passing 'aggregatedFullText' = true, 2nd by passing 'aggregatedFullText' = false, get analysis.current.usage from both requests and sum them up

  6. Cost per use - 4.(cost)/ 5.(platform(s) usage)
  7. % of budget, PO Lines and Fund Code are not supported for initial release

Full Text Requests:

  1. Publishers Platforms column - usage.platforms.keys - might have to filter based on "publisherPlatform" being 'Publisher', 'Non-publisher' or 'ALL'
  2. Usage for each publisher platform per month is given in response above - usage.platforms.keys.counts - usage.platforms.keys.counts[0] starts with 'fiscalMonth' passed in query parameter
  3. Total Count for each publisher platform(each row total) - sum of counts of usage.platforms.keys.counts
  4. Total Usage for all Publisher/Non-Publisher/ALL Platforms(Based on selection) - For each month for example -
    1. First filter result set to include objects based on "publisherPlatform" 
    2. Ex: January = usage.platforms.key1.counts[0] + usage.platforms.key2.counts[0] + .....
    3. Ex: February = usage.platforms.key1.counts[1] + usage.platforms.key2.counts[1] + .....
  5. Final total for all months = Sum of total usage computed in 4. for all months - For Ex: January total usage + February total usage + ...... Dec total usage - To confirm with khalilah reg mockup values [ Sobha DuvvuriKG: will revise mockup but that total represents total for all months.] - Update - After mockup has been revised, numbers now match and formula in 5. is correct.

...

Expand

Mockup: https://drive.google.com/drive/folders/1yQdqZymj8UQ1iLOtcEYX67kYm0DZVkJV

Endpoint: GET https://apis.ebsco.com/uc/costperuse/title/<titleId>/<packageId>

Sample Request: 

Code Block
curl --location --request GET 'https://apis.ebsco.com/uc/costperuse/title/356/473?fiscalYear=2019&fiscalMonth=Jul&analysisCurrency=AUD&aggregatedFullText=false' \
--header 'custkey: <encrypted cust id>' \
--header 'Authorization: Bearer <auth token>'


Sample Response:

Code Block
{
    "usage": {
        "platforms": {
            "Wiley Online Library": {
                "counts": [
                    0,
                    1,
                    3,
                    1,
                    3,
                    1,
                    16,
                    1,
                    null,
                    null,
                    null,
                    null
                ],
                "publisherPlatform": true
            },
            "EBSCOhost": {
                "counts": [
                    2,
                    null,
                    1,
                    null,
                    null,
                    null,
                    3,
                    4,
                    null,
                    null,
                    null,
                    null
                ],
                "publisherPlatform": false
            }
        }
    },
    "analysis": {
        "current": {
            "cost": 141.8806,
            "usage": 26,
            "costPerUse": 5.456946153846153
        },
        "previous": {
            "usage": 52
        }
    }
}


Details needed by mockup:

  1. Fiscal Year - Will be selected in drop-down and passed to backend - this can be passed to api

  2. Publisher Platform Dropdown Values - Publisher, Non-Publisher, ALL - Khalilah to decide whether this will be in Settings → eHoldings → Usage Consolidation → PublisherPlatform or title level or both where title level setting overrides the Settings level selection   [ Sobha DuvvuriKG: There will be a Default Platform display setting: values will be Publisher Platform only, Non-Publisher Platform only, All. Default selection will be All. When a user is on a package/title-package/title record, s/he can override the default setting with the Filter by platforms - filter.]

  3. Table 1 - Holdings Summary table
    1. Text in Column 1 of table 1 is going to be name of the packages that this title is selected in - we need to get list of packages that this title is selected in to populate these values in table.
    2. Text in Column 2 of table 2 is coverage details - currently, we have a way to figure out coverage settings of a resource(either managed/custom coverage) as shown in the screenshot below using resources endpoint of MODKBEKBJ - Display the coverage details of the resource in this column
    3. Title Cost - analysis.current.cost from response - 0 if not given in response
    4. Usage - analysis.current.usage from response
    5. Cost Per Use - c./d. - cost in c divided by usage in e.
  4. Table 2 - Full text request by platform usage
    1. Platform - usage.platforms.<keys> based on 'publisherPlatform' selection
    2. Counts Jan - Dec - usage.platforms.<keys>.counts based on 'publisherPlatform' selection
    3. Total at the end of each row - Sum of b. above for each platform
    4. Publisher - usage.platforms.<keys>.publisherPlatform - true/false
    5. All Publisher platforms total - where usage.platforms.<keys>.publisherPlatform = true
      1. for Jan for example - usage.platforms.<key1>.counts[0] + usage.platforms.<key2>.counts[0] + ......
      2. for Feb for example - usage.platforms.<key1>.counts[1] + usage.platforms.<key2>.counts[1] + ......
      3. Total for example - Jan + Feb + .... + Dec
    6. All non-publisher platforms total - where usage.platforms.<keys>.publisherPlatform = false
      1. for Jan for example - usage.platforms.<key1>.counts[0] + usage.platforms.<key2>.counts[0] + ......
      2. for Feb for example - usage.platforms.<key1>.counts[1] + usage.platforms.<key2>.counts[1] + ......
      3. Total for example - Jan + Feb + .... + Dec
    7. All platforms - irrespective of publisher platform
      1. for Jan for example - usage.platforms.<key1>.counts[0] + usage.platforms.<key2>.counts[0] + ......
      2. for Feb for example - usage.platforms.<key1>.counts[1] + usage.platforms.<key2>.counts[1] + ......
      3. Total for example - Jan + Feb + .... + Dec
    8. Note: 

      Note

      title record in eHoldings is a detailed view based on kbid(titleid) only and gives list of packages that the title belongs to on the title record - a title is always associated with at least one package. 
      Cost-per-use API provides cost and usage information only for a title associated with a package. 

      From the list of packages listed on a title record, we can pass any package id along with title id to get usage information for a title.

      See examples below:

      Request for titleid = 50974 within package id 34

      Code Block
      curl --location --request GET 'https://apis.ebsco.com/uc/costperuse/title/50974/34?fiscalYear=2019&fiscalMonth=Jan&analysisCurrency=AUD&aggregatedFullText=true' \
      --header 'custkey: 1234-5678' \
      --header 'Authorization: Bearer token'

      Response:

      Code Block
      {
          "usage": {
              "platforms": {
                  "EBSCOhost": {
                      "counts": [
                          22,
                          37,
                          35,
                          53,
                          19,
                          16,
                          11,
                          4,
                          31,
                          52,
                          null,
                          null
                      ],
                      "publisherPlatform": false
                  }
              }
          },
          "analysis": {
              "current": {
                  "usage": 280
              },
              "previous": {
                  "usage": 379
              }
          }
      }

      Request for title id = 50974 within package id 667

      Code Block
      curl --location --request GET 'https://apis.ebsco.com/uc/costperuse/title/50974/667?fiscalYear=2019&fiscalMonth=Jan&analysisCurrency=AUD&aggregatedFullText=true' \
      --header 'custkey: 1234-5678' \
      --header 'Authorization: Bearer token'

      Response:

      Code Block
      {
          "usage": {
              "platforms": {
                  "EBSCOhost": {
                      "counts": [
                          22,
                          37,
                          35,
                          53,
                          19,
                          16,
                          11,
                          4,
                          31,
                          52,
                          null,
                          null
                      ],
                      "publisherPlatform": false
                  }
              }
          },
          "analysis": {
              "current": {
                  "usage": 280
              },
              "previous": {
                  "usage": 379
              }
          }
      }

      Notice how irrespective of package associated with a title, the usage counts are the same and are at a platform level.


...

CostPerUse team is developing a separate endpoint to support this. Earlier, the decision was to add this information to HoldingsIQ /custid endpoint but that decision has changed due to difficulties in architecture.

Expand

Endpoint: GET https://apis.ebsco.com/uc/costperuseusageanalysis/metrictypeanalysisMetricType

Sample Request:

Code Block
curl --location --request GET 'https://apis.ebsco.com/uc/costperuseusageanalysis/metrictypeanalysisMetricType' \ --header 'custkey: <encrypted cust id>'Note that authorization is not needed for this request
--header 'Authorization: Bearer token'

Sample Response:

Code Block
{
	"metricTypeId": 36,
	"description": "string" 
}


Info
  1. In the above response, metric type id can be either 36 or 33

    33 is Total Item Requests

    36 is Unique Item Requests

  2. If a customer is not signed up for UC, we'll get a 200 but an empty object for response.
  3. These details are an agreement of contract between our team and the costperuse team. Please note that this endpoint is yet to be developed - associated Rally story -https://rally1.rallydev.com/#/59208701801d/dashboard?detail=%2Fuserstory%2F438911413740has been developed and released.