Developer
User guidesDeveloper websiteHelp centerLog in
  • Welcome!
  • Organisations structure
    • Datamart
    • Users and roles
  • User points
    • User identifiers
      • Networks IDs
        • Device-based Network IDs
          • Custom Device ID integration
          • ID5
          • First ID
        • User-based Network IDs
          • Custom User ID integration
          • UTIQ martechpass
      • Accounts
      • Emails
      • Device identifiers
    • User activities and events
    • Compartments
    • User profiles
    • User segments
    • Hyper point & Quarantine
  • Data model
    • Defining your schema
    • Computed fields
      • Concepts
      • Quickstart
      • Examples
  • Data ingestion
    • Real time user tracking
      • Website tracking
      • Mobile apps tracking
      • Ads exposure tracking
      • AMP tracking
      • Conversions tracking
      • Email views and clicks
      • Tracking API
      • Event rules
      • Activity analyzers
    • Bulk processing
      • Imports
        • User activities import
        • User profiles import
        • User choices import
        • Segments import
      • Deletions
        • User identifiers deletion
        • Device points deletion
        • User points deletion
      • User identifiers association
      • Integration batch
    • Activities analytics
    • Data warehouse
      • Preliminary setup
        • BigQuery
      • Create data warehouse
  • Querying your data
    • OTQL queries
    • OTQL examples
    • GraphQL queries
    • UserPoint API
    • User activities
    • Activities analytics queries
      • API Quickstart
      • Dimensions and metrics
      • Use cases
    • Funnel API
  • Alerting
    • Alert configurations
  • Data visualisation
    • Quickstart
    • Dashboards
    • Sections and cards
    • Charts
    • Datasets and data sources
      • Using a data file data source
    • Transformations
    • Filters
    • Cookbook
    • Reference
  • Advanced usages
    • Audience segmentation
      • Audience features
      • Segment builders
      • Audience segment metrics
      • Audience segment feed
        • Building new feeds
        • Monitoring a feed
        • Curated Audiences (SDA)
      • Edge segments
      • Cohort-based Lookalike
    • Contextual targeting
      • Setup
      • Activation
        • Google Ad Manager
        • Xandr (through prebid.js)
      • API documentation
    • Exporting your data
      • Query Exports
      • Datamart replication
    • Data privacy compliance
      • User choices
      • Cleaning rules
      • Exercise of user rights
      • Cookies
    • Campaigns
    • Automations
      • Email routers
      • Email renderers
      • Opt-in provider
      • Custom action plugins
      • Usage limits for automations
    • Plugins
      • Concepts
      • Creation & Deployment
      • Coding your plugin
      • Manage existing plugins
      • Layouts
      • Presets
      • Monitoring
      • Throttling
      • Batching (for external feeds)
    • Platform monitoring
      • Resources usage
        • Dimensions and metrics
      • Collection volumes
        • Dimensions and metrics
      • Events ingestion monitoring
        • Dimensions and metrics
    • Data Clean Room
      • Bunker
      • Clean room
  • Resources
    • Tutorial: Data Ingestion
      • Your first events
        • Add the mediarithmics tag
          • Getting the tag
          • Adding the tag
        • Send events using the tag
          • Adding event properties
          • Finding the UserEvent type in your schema
          • Matching your schema
          • Standard events
      • Your first bulk imports
        • API basics
          • Authentication
          • Your first API call
        • Send documents using the API
          • Requirements
          • Sending documents
    • Using our API
      • Authentication
    • Tools & libraries
      • mics CLI
      • JS Tag
      • Plugin SDK
    • Data cubes
      • Creating a report
      • Reference
Powered by GitBook
On this page
  • Installation
  • Getting started
  • Creating an alias
  • Config commands
  • Help command
  • Whoami command
  • Autocomplete

Was this helpful?

Export as PDF
  1. Resources
  2. Tools & libraries

mics CLI

PreviousTools & librariesNextJS Tag

Last updated 4 years ago

Was this helpful?

The platform is built using an API first approach. You can manage nearly anything using Unfortunately, some actions can require you to use a combination of different APIs, and you'll have to handle authentication for every request.

Using mediarithmics Command Line Interface, you can simplify some actions and you won't have to add authentication headers in every request.

Installation

The CLI for mediarithmics is distributed as an NPM package. To use it, install it globally using

npm install -g @mediarithmics-ps/mics-cli

You need access to mediarithmics private packages to run this command. Contact us if required.

Getting started

On a fresh install, any command will prompt you for your . You won't have to enter it anymore.

You can use a command like mics-cli config:list to trigger this prompt.

# Run this command on a fresh install
mics-cli config:list
# The prompt will ask you for MICS API Token
# Simply copy/paste it and press enter
# The token will be saved and your command will be executed
Please enter a value for authToken (MICS API token) : *******

Creating an alias

The invoke command is mics-cli. If you prefer something else because it's shorter or just before you want, you can use

# Creates an alias for the mics-cli invoke command
alias mics="mics-cli"

# From now, all mics-cli commands can be called with mics
mics config:list

Config commands

The mics CLI has a set of config commands. They are particularly useful to manage your authentication token.

Lists all your configuration variables.

mics-cli config:list

Get the value of a configuration variable

# mics-cli config:get <VARIABLE>
mics-cli config:get authToken

Set the value of a configuration variable

# mics-cli config:set <VARIABLE> <VALUE>
# Will prompt for the value if empty
mics-cli config:set authToken

Help command

Shows all available commands, and other useful information.

mics-cli help

Whoami command

Retrieves user information based on the authentication token

# The output can be very large, 
# you may want to save it to a file
mics-cli whoami > whoami.txt
GET /v1/connected_user
{
    "id": "<USER_ID>",
    "first_name": "<USER_FIRSTNAME>",
    "last_name": "<USER_LASTNAME>",
    "email": "<USER_EMAIL>",
    "locale": null,
    "workspaces": [
     {
            "organisation_id": "<ORG_ID>",
            "customer_type": "ENTERPRISE",
            "organisation_name": "<ORG_NAME>",
            "administrator": false,
            "role": "CUSTOMER_ADMIN",
            "community_id": "<COMMUNITY_ID>",
            "administrator_id": null,
            "datamarts": [
                {
                    "id": "<DATAMART_ID>",
                    "name": "<DATAMART_NAME>",
                    "organisation_id": "<ORG_ID>",
                    "token": "<TOKEN>",
                    "creation_date": 1582031749723,
                    "time_zone": "Europe/Paris",
                    "type": "DATAMART",
                    "datafarm": "<DATAFARM>",
                    "storage_model_version": "v201709",
                    "user_point_system_version": "v201901",
                    "region": "EUROPE",
                    "archived": false,
                    "audience_segment_metrics": [...]
                }
            ]
        }
        ...
    ]
    ...
}

Autocomplete

Autocomplete installation instructions can be displayed based on your shell using the autocomplete command.

USAGE
  $ mics-cli autocomplete [SHELL]

ARGUMENTS
  SHELL  shell type

OPTIONS
  -r, --refresh-cache  Refresh cache (ignores displaying instructions)

EXAMPLES
  $ mics-cli autocomplete
  $ mics-cli autocomplete bash
  $ mics-cli autocomplete zsh
  $ mics-cli autocomplete --refresh-cache

our API.
authentication token