Open APIs

 View Only
  • 1.  PrepayBalanceManagement Bucket API query

    Posted Oct 29, 2021 10:34
    Edited by Dhaval Solanki Nov 01, 2021 03:38
    Hello,

    We want to implement bucket api, so we have a query that suppose If my product had subscription of three buckets facebook, whatsapp and voice then on getBucket API we want to return list of three bucket, for one subscription of my product offer or just one record of subscription. So bucket id will be subcriptionId or balanceId.

    @Jonathan Goldberg Thanks for you reply.
    So as per your comment I am updating the question

    In PrepayBalanceManagement TMF654 my query is
    Suppose I have a product offer plan with three bucket
    1) Facebook 2gb
    2) Youtube 5gb
    3) default 10gb

    Now if I am onboarding a customer and customer subscribes above plan then, he will have 3 buckets one for facebook, one for youtube, and last will be default.
    So in PrepayBalanceManagement when we implement GET without ID - which searches for the entity using filter criteria, in response for bucketId will, we have to give subscriptionId or particular primary key id of facebook or youtube bucket. 
     



    ------------------------------
    Dhaval Solanki
    Sterlite Technologies Limited
    ------------------------------


  • 2.  RE: PrepayBalanceManagement Bucket API query

    TM Forum Member
    Posted Oct 31, 2021 03:12
    Hi Dhaval
    Not sure what exactly you are asking. In general, TMF Open APIs provide two variations on GET:
    • GET with ID - retrieve the entity by its primary key (the ID field of the entity)
    • GET without ID - searches for the entity using filter criteria
    Can you match your use case into one of the above alternatives?

    ------------------------------
    Jonathan Goldberg
    Amdocs Management Limited
    Any opinions and statements made by me on this forum are purely personal, and do not necessarily reflect the position of the TM Forum or my employer.
    ------------------------------



  • 3.  RE: PrepayBalanceManagement Bucket API query

    Posted Nov 01, 2021 09:52
    @Jonathan Goldberg Thanks for you reply.
    So as per your comment I am updating the question

    In PrepayBalanceManagement TMF654 my query is
    Suppose I have a product offer plan with three bucket
    1) Facebook 2gb
    2) Youtube 5gb
    3) default 10gb

    Now if I am onboarding a customer and customer subscribes above plan then, he will have 3 buckets one for facebook, one for youtube, and last will be default.
    So in PrepayBalanceManagement when we implement GET without ID - which searches for the entity using filter criteria, in response for bucketId will, we have to give subscriptionId or particular primary key id of facebook or youtube bucket.

    ------------------------------
    Dhaval Solanki
    Sterlite Technologies Limited
    ------------------------------



  • 4.  RE: PrepayBalanceManagement Bucket API query

    TM Forum Member
    Posted Nov 04, 2021 05:02
    Thanks Dhaval for clarifying
    The Bucket entity, like all top-level (managed) entities in the Open API, has an ID (Bucket.id), which is unique across the entire population of Buckets (no matter which customer owns the bucket, or which usage type the bucket serves).
    So whenever you retrieve a bucket (doesn't matter if retrieve by ID or search by owning customer, or whatever), the id in the returned resource will be the unique ID of the bucket. In the published user guide, you can see examples of (admittedly not very realistics) IDs, 11 and 12 in the GET response.
    There is no concept of subscription in Open API (or in SID - information framework), the equivalent is Product. A bucket can cover multiple products (Bucket.product is an array of ProductRef), and when you retrieve a bucket you would expect to see the IDs of all the products populated in those ProductRefs.

    Hope it helps

    P.S. I can see that there is discrepancy between the example contents and the query string in the user guide, I plan to open a defect report on that.

    ------------------------------
    Jonathan Goldberg
    Amdocs Management Limited
    Any opinions and statements made by me on this forum are purely personal, and do not necessarily reflect the position of the TM Forum or my employer.
    ------------------------------



  • 5.  RE: PrepayBalanceManagement Bucket API query

    TM Forum Member
    Posted Jul 13, 2023 16:41

    Hello Jonathan, 

    I'm facing something similar, but let's stick to Dhaval's example. I assume that each customer in his example has always three buckets. Lets assume these have the following names:

    • "name":"DATA_FACEBOOK"
    • "name":"DATA_YOUTUBE"
    • "name":"DATA_DEFAULT"

    I could imagine that a common use case for a query is a request by a specific customer-id (e.g. a frontend shall display the remaining data volumes of the subscriber). How would the GET request look like then? My assumptions: As we need to get a list of all three buckets, we need to use the "GET without ID". We also want to filter for all buckets related to a specfic customer, therefore a filtering regarding the related party might be approriate. I would use:

    GET /tmf-api/prepayBalanceManagement/v4/bucket/?fields=relatedParty.id=cust1 

    (the "cust1" value is taken from the example in the documentation pdf.) Then an implementation of TMF654 should return all three buckets of the given customer. 

    [
     {
      "id": "132141",
      "href": "prepayBalanceManagement/v4/bucket/132141",
      "description": "this bucket holds the remaning data volume for facebook traffic",
      "name": "DATA_FACEBOOK",
      "@type": "Bucket",
      "remainingValue": {
        "amount": 1.25,
        "units": "GB"
      },

      "relatedParty": [
      {
      "id": "cust1",
      "href": "/partyManagement/customer/cust1",
      "name": "jerry watts",
      "role": "customer"
      }

     },

     {
      "id": "132142",
      "href": "prepayBalanceManagement/v4/bucket/132142",
      "description": "this bucket holds the remaning data volume for youtube traffic",
      "name": "DATA_YOUTUBE",
      "@type": "Bucket",
      "remainingValue": {
        "amount": 2.38,
        "units": "GB"
       },

      "relatedParty": [
      {
      "id": "cust1",
      "href": "/partyManagement/customer/cust1",
      "name": "jerry watts",
      "role": "customer"
      }

     },

     {
      "id": "132143",
      "href": "prepayBalanceManagement/v4/bucket/132142",
      "description": "this bucket holds the remaning data volume for general traffic",
      "name": "DATA_DEFAULT",
      "@type": "Bucket",
      "remainingValue": {
        "amount": 4.12,
        "units": "GB"

       },

      "relatedParty": [
      {
      "id": "cust1",
      "href": "/partyManagement/customer/cust1",
      "name": "jerry watts",
      "role": "customer"
      }

     },

    ]

    Is this how it is supposed to be done?

    Also: In the documentation pdf I also found an array "bucketBalance": [...] which can obviously contain several "remainingValues" but this entity seems not to be present in the Swagger/yaml file. Would it be an option for Dhavals problem to make use of this to have all three amounts of remaining data (facebook, youtube, default) transmitted within one single bucket?

    BR

    Ralf 



    ------------------------------
    Ralf WS
    Dave Raymer
    ------------------------------