2.1.0 • Published 5 years ago

@limio/catalog v2.1.0

Weekly downloads
101
License
UNLICENSED
Repository
github
Last release
5 years ago

Limio - Javascript API Wrapper

A package that provides simple functions to access your Limio product catalogue.

Getting started

In order to get started you'll need to install the package and get an API key (TBC)

Installation

npm install @limio/catalog

A simple request

The following code snippet is the a basic request you can use to retrieve some campaign details & items from your catalogue:

// Require and setup limio with your access token
const limio = require('@limio/catalog').Limio('ACCESS_TOKEN_HERE')

// Or using ES modules
import { Limio } from '@limio/catalog'
const limio = Limio('ACCESS_TOKEN_HERE')

limio.getLanding({
  catalog_id: '1',
  tag: '/tags/TestTag/1YJDE',
  segments: ['/segments/TestSegment/Segment'],
  attributes: {
    Payment_Term__c: 'Due Upon Receipt',
    Auto_Renewal__c: 'Yes',
    Initial_Term__c: '012W',
    Offer_Type1__c: 'Gift'
  }
})
  .then(result => {
    // Do whatever you need to with the data
    console.log(result)
  })
  .catch(err => {
    // Handle this how you like (docs to follow)
    console.log(err)
  })

API Methods

getLanding

This method will return tagged campaign details, all offer items that are tagged and match your inputted options & any associated offers.

limio.getLanding({
  ...your options here...
})
NameDescriptionRequired
catalog_idString - The ID of the catalog you are queryingYes
tagString - Path of tag item to queryYes
segmentsArray - Path or paths of segments to queryNo
identityString - Unique identifier of customer so we can query with matching segmentsNo
attributesObject - Attributes to query (key being attribute name)No

Example response

{
  "tagDirInfo": {
    "item_id": "ID_HERE",
    "segment_id": "ID_HERE",
    "id": "ID_HERE",
    "path_parts": [
      "offers",
      "Limio Landing Campaign"
    ],
    "parent_path": "/offers",
    "path": "/offers/Limio Landing Campaign",
    "name": "Limio Landing Campaign",
    "type": "dir",
    "data": {
      "attributes": {
        "primary_color": "#f47c24",
        "secondary_color": "#2b2145",
        "tertiary_color": "#697689"
      },
      "name": "Limio Landing Campaign",
      "headline": "Choose the subscription that suits you",
      "subline": "Unlock today’s Premium stories. Enjoy unrestricted access to Premium articles.",
      "validFrom": "20190204",
      "validTo": "20190218",
      "status": "draft",
      "tags": [
        "/tags/Billboard/1DYNE"
      ],
      "images": [],
      "description": ""
    }
  },
  "items": [
    {
      "item_id": "ID_HERE",
      "segment_id": "ID_HERE",
      "id": "ID_HERE",
      "path_parts": [
        "offers",
        "Limio Landing Campaign",
        "Limio Regular Subscription"
      ],
      "parent_path": "/offers/Limio Landing Campaign",
      "path": "/offers/Limio Landing Campaign/Limio Regular Subscription",
      "name": "Limio Regular Subscription",
      "type": "item",
      "data": {
        "attributes": {
          "CTA_Txt": "Subscribe now",
          "Payment_Term__c": "Due Upon Receipt"
        },
        "name": "Limio Regular Subscription",
        "headline": "Choose the subscription that suits you",
        "subline": "Unlock today’s Premium stories. Enjoy unrestricted access to Premium articles.",
        "validFrom": "20190204",
        "validTo": "20190218",
        "status": "draft",
        "tags": [
          "/tags/Billboard/1DYNE"
        ],
        "images": [],
        "description": "",
        "url": "/offers/Limio Landing Campaign/Limio Regular Subscription",
        "segments": [
          "/segments/regions/UK/UK/GB"
        ],
        "products": [
          "/products/UK/Limio/Digital edition, Audio edition, Limio"
        ],
        "price": [
          {
            "name": "charge_1",
            "label": "Charge 1",
            "value": "50.00",
            "currencyCode": "GBP",
            "type": "recurring",
            "trigger": "subscription_start",
            "repeat_interval": 1,
            "repeat_interval_type": "months",
            "repeat_count": 0,
            "delay_interval": null,
            "attributes": []
          }
        ],
        "baseTemplate": "/config/templates/offers"
      }
    }
  ],
  "associatedOffers": {
    "upSellOffers": [
      {
        "item_id": "ID_HERE",
        "segment_id": "ID_HERE",
        "id": "ID_HERE",
        "path_parts": [
          "offers",
          "Limio Relevant Campaign",
          "Regular Related Subscription"
        ],
        "parent_path": "/offers/Limio Relevant Campaign",
        "path": "/offers/Limio Relevant Campaign/Regular Related Subscription",
        "name": "Regular Related Subscription",
        "type": "item",
        "data": {
          "attributes": {
            "CTA_Txt": "",
            "Payment_Term__c": "Due Upon Receipt"
          },
          "name": "Regular Related Subscription",
          "headline": "Check out the relevant Limio offers below!",
          "subline": "Relevant subline here",
          "validFrom": "20190204",
          "validTo": "20190218",
          "status": "draft",
          "tags": [
            "/tags/Billboard/1DYNB"
          ],
          "url": "/offers/Limio Relevant Campaign/Regular Related Subscription",
          "segments": [
            "/segments/regions/UK/UK/GB"
          ],
          "products": [
            "/products/UK/Limio/Digital edition, Audio edition, Limio"
          ],
          "price": [
            {
              "name": "charge_1",
              "label": "Charge 1",
              "value": "65.00",
              "currencyCode": "GBP",
              "type": "recurring",
              "trigger": "subscription_start",
              "repeat_interval": 1,
              "repeat_interval_type": "months",
              "repeat_count": 0,
              "delay_interval": null,
              "attributes": []
            }
          ],
          "baseTemplate": "/config/templates/offers"
        }
      }
    ],
    "crossSellOffers": [],
    "saveOffers": []
  }
}

getOffers

This method will return all offer items that match your inputted options.

limio.getOffers({
  ...your options here...
})
NameDescriptionRequired
catalog_idString - The ID of the catalog you are queryingYes
tagString - Path of tag item to queryNo
segmentsArray - Path or paths of segments to queryNo
attributesObject - Attributes to query (key being attribute name)No

Example response

[
  {
    "item_id": "ID_HERE",
    "segment_id": "ID_HERE",
    "id": "ID_HERE",
    "path_parts": [
      "offers",
      "Limio Landing Campaign",
      "Limio All Inclusive"
    ],
    "parent_path": "/offers/Limio Landing Campaign",
    "path": "/offers/Limio Landing Campaign/Limio All Inclusive",
    "name": "Limio All Inclusive",
    "type": "item",
    "data": {
      "attributes": {
        "CTA_Txt": "Go All Inclusive"
      },
      "name": "Limio All Inclusive",
      "headline": "Choose the subscription that suits you",
      "subline": "Unlock today’s Premium stories. Enjoy unrestricted access to Premium articles.",
      "validFrom": "20190204",
      "validTo": "20190218",
      "status": "draft",
      "tags": [
        "/tags/Billboard/1DYNE"
      ],
      "images": [],
      "description": "",
      "url": "/offers/Limio Landing Campaign/Limio All Inclusive",
      "segments": [
        "segments/regions/UK/UK/GB"
      ],
      "products": [
        "/products/UK/Limio/Digital edition, Audio edition, Limio"
      ],
      "price": [
        {
          "name": "charge_1",
          "label": "Charge 1",
          "value": "100.00",
          "currencyCode": "GBP",
          "type": "recurring",
          "trigger": "subscription_start",
          "repeat_interval": 1,
          "repeat_interval_type": "months",
          "repeat_count": 0,
          "delay_interval": null,
          "attributes": []
        }
      ],
      "baseTemplate": "/config/templates/offers",
      "associations": {
        "upSell": [
          "offers/Limio Relevant Campaign/Regular Related Subscription"
        ],
        "crossSell": [],
        "save": []
      }
    }
  }
]

getProducts

This method will return all products that match your inputted options.

limio.getProducts({
  ...your options here...
})
NameDescriptionRequired
catalog_idString - The ID of the catalog you are queryingYes
attributesObject - Attributes to query (key being attribute name)No

Example response

[
  {
    "item_id": "ID_HERE",
    "segment_id": "ID_HERE",
    "id": "ID_HERE",
    "path_parts": [
      "products",
      "AFPR",
      "Limio",
      "Weekly print edition"
    ],
    "parent_path": "/products/AFPR/Limio",
    "path": "/products/AFPR/Limio/Weekly print edition",
    "name": "Weekly print edition",
    "type": "item",
    "data": {
      "attributes": {
        "Product_Format__c": "Print Only",
        "Family": "Limio"
      },
      "category": "product",
      "sku": "AFPR_Student",
      "baseTemplate": "products/Product"
    }
  }
]

getSegments

This method will return all segments that match your inputted options.

limio.getSegments({
  ...your options here...
})
NameDescriptionRequired
catalog_idString - The ID of the catalog you are queryingYes
attributesObject - Attributes to query (key being attribute name)No

Example response

[
  {
    "item_id": "ID_HERE",
    "segment_id": "ID_HERE",
    "id": "ID_HERE",
    "path_parts": [
      "segments",
      "BusinessUnit",
      "Student"
    ],
    "parent_path": "/segments/BusinessUnit",
    "path": "/segments/BusinessUnit/Student",
    "name": "Student",
    "type": "item",
    "data": {
      "attributes": {
        "2Code": "ST",
        "3Code": "STU"
      },
      "category": "segment",
      "baseTemplate": "segments/Segment"
    }
  }
]

getAssets

This method will return all offer items that match your inputted options.

limio.getAssets({
  ...your options here...
})
NameDescriptionRequired
catalog_idString - The ID of the catalog you are queryingYes
assetPathString - Path of the asset you are queryingYes

Example response

{
  "path": "/limio/catalogs/1/items/assets/text/javascript/Footerjs",
  "position": "Footer",
  "props": {
    "bgColor": "#2fc151",
    "isUpsideDown": false,
    "text": "Footer"
  }
}

2.1.0

5 years ago

2.0.9

5 years ago

2.0.8

5 years ago

2.0.7

5 years ago

2.0.6

5 years ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.28

5 years ago

1.0.26

5 years ago

1.0.25

5 years ago

1.0.24

5 years ago

1.0.23

5 years ago

1.0.22

5 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago