Authentication

The ChartMogul API uses HTTP Basic Authentication.

ChartMogul allows you to create multiple API keys, and we strongly encourage you to use a separate key for each external application or service you connect to ChartMogul. With every request made to the ChartMogul API, you must provide your API Key as basic auth credentials. Learn more about creating and managing API Keys.

Find your API Keys by navigating to Profile > View Profile and scrolling down to API Keys.

Click NEW API KEY to create a new key.

1842

API Keys table

📘

Updates to developer libraries

Starting October 29 2021, we are updating our developer libraries to support enhanced API Access Management. The latest versions of our libraries now only require an API Key for authentication.

When using older versions that still require an Account Token and a Secret Key, please use the same API Key for both of these values. For example, if your API Key is 717098869e029c50690d80913728eb89 then set API Token to 717098869e029c50690d80913728eb89 and Secret Key to 717098869e029c50690d80913728eb89

Once you have your API Key, you can quickly verify it by sending us an authentication ping. You will receive a satisfying pong! in response if your credentials are correct.

curl -X GET "https://api.chartmogul.com/v1/ping" \
     -u YOUR_API_KEY:
ChartMogul.global_api_key = '<API key goes here>'
ChartMogul::Ping.ping
const ChartMogul = require('chartmogul-node');
const config = new ChartMogul.Config(process.env.CHARTMOGUL_API_KEY);
ChartMogul.Ping.ping(config)
    .then(res => console.log(res))
    .catch(err => console.error(err))
<?php
ChartMogul\Configuration::getDefaultConfiguration()
    ->setApiKey('<YOUR_API_KEY>');
print_r(ChartMogul\Ping::ping()->data);
?>
import cm "github.com/chartmogul/chartmogul-go"

api := cm.API{
    ApiKey: os.Getenv("CHARTMOGUL_API_KEY"),
}
ok, err := api.Ping()
if err != nil {
    fmt.Printf("This didn't work out: %v", err)
} else {
    fmt.Println(ok)
}
import chartmogul

config = chartmogul.Config('api_key')
chartmogul.Ping.ping(config).get()
{
  "data":"pong!"
}
#<ChartMogul::Ping:0x007ff9f127d628 
@data="pong!",
{ data: 'pong!' }
pong!
true
<Ping{data='pong!'}>