With every request made to the ChartMogul API you must provide your Account Token and Secret Key as basic auth credentials.
You can find your Account Token and Secret Key in the ChartMogul API Admin page. You can reach it by clicking the gear icon in the bottom left of your account. Here you will see an API tab with the Account Token and Secret Key.


Admin API page
Unable to access the Admin page?
You need to be an admin in your ChartMogul account to access this page. If you are unable to access the page to retrieve API credentials, please contact your account owner for access.
Once you have your Account Token and Secret Key, you can quickly verify them 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_ACCOUNT_TOKEN:YOUR_SECRET_KEY
ChartMogul.account_token = '<Account key goes here>'
ChartMogul.secret_key = '<Secret key goes here>'
ChartMogul::Ping.ping
const ChartMogul = require('chartmogul-node');
const config = new ChartMogul.Config(process.env.CHARTMOGUL_ACCOUNT_TOKEN, process.env.CHARTMOGUL_SECRET_KEY);
ChartMogul.Ping.ping(config)
.then(res => console.log(res))
.catch(err => console.error(err))
<?php
ChartMogul\Configuration::getDefaultConfiguration()
->setAccountToken('<YOUR_ACCOUNT_TOKEN>')
->setSecretKey('<YOUR_SECRET_KEY>');
print_r(ChartMogul\Ping::ping()->data);
?>
import cm "github.com/chartmogul/chartmogul-go"
api := cm.API{
AccountToken: os.Getenv("CHARTMOGUL_ACCOUNT_TOKEN"),
AccessKey: os.Getenv("CHARTMOGUL_SECRET_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('token', 'secret')
chartmogul.Ping.ping(config).get()
{
"data":"pong!"
}
#<ChartMogul::Ping:0x007ff9f127d628
@data="pong!",
{ data: 'pong!' }
pong!
true
<Ping{data='pong!'}>
Updated 7 months ago