Skip to content
Last update: January 30, 2024

Getting started

This section explains how to prepare your environment for testing xAPI.

Prerequisites

  • VC platform 3.0 or higher.
  • The platform is configured to use ElasticSearch engine.
    appsettings.json
    "Search": {
        "Provider": "ElasticSearch",
        "Scope": "default",
        "ElasticSearch": {
            "Server": "localhost:9200",
            "User": "elastic",
            "Key": "",
            "EnableHttpCompression": ""
        },
        "OrderFullTextSearchEnabled": true
    }
    

Presettings

To start using xAPI:

  1. Open the Platform and go to Settings.
  2. Select Catalog.
  3. Select Search.
  4. Enable Store serialized catalog objects in index option:

    Catalog-enabled

  5. Rebuild index.

Test environment

To set up the test environment:

  1. Install vc-module-experience-api on the platform version 3.0 or higher, using this guide.
  2. Restart the platform instance.
  3. Open GraphQL UI playground in the browser: http://{platform url}/ui/playground
View sample request
{
  product(id: "0f7a77cc1b9a46a29f6a159e5cd49ad1")
  {
    id
    name

    properties {
      name
      type
      values
    }
  }

  products(query: "sony" fuzzy: true filter: "price.USD:(400 TO 1000]")
  {
    totalCount
    items {
      name
      id
      prices (currency: "USD") {
        list
        currency
      }
    }
  }
}

Authorization and token usage

Some GraphQL queries and mutations require addition authorization. To test the query or mutation without authorization errors:

  1. Open the Virto Commerce API Docs (v1) in your browser.
  2. Authorize as an administrator or manager.

    Auth

  3. Expand POST/connect/token section to fill in the required fields with appropriate credentials, then click Execute.

    token

  4. Copy the token that appears in the field below:

    token

Providing token in Playground is decribed in the Playground section.

Providing token in Postman is described in Postman section.