Skip to navigation

Your First API Call

View as Markdown

This guide walks you through making your first successful API call to the NinjaTrader Partner API, covering authentication, request structure, and response handling.

Prerequisites

Before making your first API call, ensure you have:

  • ✅ Partner API credentials (API key and secret)
  • ✅ Development environment set up
  • ✅ HTTP client ready (curl, Postman, or code library)

If you haven’t completed these steps, start with our 5-Minute Quickstart.

Step 1: Authenticate and Get Access Token

All API requests require a valid access token. Here’s how to obtain one:

POST
/v1/auth/accesstokenrequest
curl -X POST https://demo.tradovateapi.com/v1/auth/accesstokenrequest \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"password": "string"
}'
Response
{
"errorText": "string",
"hibpHint": "EmailAndPasswordCompromised",
"accessToken": "string",
"expirationTime": "2024-01-15T09:30:00Z",
"passwordExpirationTime": "2024-01-15T09:30:00Z",
"userStatus": "Active",
"userId": 1,
"name": "string",
"hasLive": true,
"hasSimPlus": true,
"showKIDs": true
}

If you’re unfamiliar with authentication, please read the Auth Overview section.

Step 2: Make Your First Data Request

Now let’s retrieve your user profile information:

GET
/v1/auth/me
curl https://demo.tradovateapi.com/v1/auth/me \
-H "Authorization: Bearer <token>"
Response
{
"errorText": "string",
"userId": 1,
"name": "string",
"fullName": "string",
"email": "string",
"emailVerified": true,
"isTrial": true,
"organizationName": "string",
"currentAccountPlan": "string",
"currentMDSubs": [
"string"
],
"currentBalance": 1.1,
"activePlugins": [
"string"
],
"isMasterAccountOwner": true
}