Your first API call, in a few minutes

Get a key, send one POST from your server, and read the response. No SDK needed.

Last updated

Get a key

Keys are issued by the Dium team. There is no self-serve portal or sandbox yet. Ask for a key and tell us the actions you need. For this guide you only need the auth.issue_token scope.

Store the key as an environment variable on your server:

Terminal
export DIUM_API_KEY="paste-your-key-here"
Keys are live credentials. Keep them on your server. Never put a key in browser JavaScript, a mobile app or a git repo. If one leaks, tell us and we will replace it.

Make your first call

This call asks Dium for a one-time sign-in token for one member. It is a good first call because it proves your key and scope work, and it changes nothing: the token simply expires after five minutes if you do not use it.

curl
curl -sS https://dium.io/api/auth.php \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: $DIUM_API_KEY" \
  -d '{"action":"issue_token","email":"[email protected]","name":"Your Name"}'

Every Dium API call has the same shape: a POST to one PHP file, a JSON body, and an action field that picks what to do.

Check the response

A working call returns HTTP 200 with success, the token and its lifetime in seconds. Your token will differ.

200 response
HTTP/1.1 200 OK
Content-Type: application/json

{
  "success": true,
  "token": "9f2c4e1ab07d53e8c6f1a2b4d9e07c35a8b61f4e2d0c9a7b",
  "expires_in": 300
}

If something is wrong, you get an HTTP error status and an error message:

Error response
HTTP/1.1 401 Unauthorized

{ "error": "..." }
StatusMost likely causeFix
400A required field is missing, such as emailSend every required field
401No key, or the key is wrongCheck the X-Api-Key header and the value of DIUM_API_KEY
403The key works but lacks the auth.issue_token scopeAsk us to add the scope

Next steps

  • Sign the member in. Redirect the browser to https://dium.io/home/autologin.php?token=...&redirect=/asq/d/your-flow/waves. The SSO guide has full server code.
  • Create a Flow for an event. Call ladder.php create with your own external_id so retries do not make duplicates. See the API reference.
  • Add sessions and sponsor pages. Use wave.php create and exhibit.php create.
  • Mount Dium on your site. Follow widgets and embeds.