{"id":3439,"date":"2018-03-04T11:09:16","date_gmt":"2018-03-04T09:09:16","guid":{"rendered":"http:\/\/modulus.help\/kb\/docs\/modulus-api\/introduction\/step-2-authentication-token\/"},"modified":"2025-11-17T12:07:57","modified_gmt":"2025-11-17T10:07:57","slug":"step-2-authentication-token","status":"publish","type":"docs","link":"https:\/\/modulus.help\/kb\/docs\/documentation\/getting-started\/step-2-authentication-token\/","title":{"rendered":"Authentication Token"},"content":{"rendered":"<p>In order to make API calls, you need first to create an authentication token. The token is a hashed key that is required in every modulus&reg; API call.<\/p>\n<h4>Request<\/h4>\n<table style=\"width: auto\">\n<tbody>\n<tr>\n<th style=\"text-align:left;\">API Name<\/th>\n<td>Authenticate<\/td>\n<\/tr>\n<tr>\n<th style=\"text-align:left;\">URL<\/th>\n<td>https:\/\/your_account.modulus.biz\/api\/cmn\/Authenticate<\/td>\n<\/tr>\n<tr>\n<th style=\"text-align:left;\">Method<\/th>\n<td>Post<\/td>\n<\/tr>\n<tr>\n<th style=\"text-align:left;\">Source<\/th>\n<td>Third Party Server<\/td>\n<\/tr>\n<tr>\n<th style=\"text-align:left;\">Recipient<\/th>\n<td>modulus&reg; Server<\/td>\n<\/tr>\n<tr>\n<th style=\"text-align:left;\">Content Type<\/th>\n<td>application\/x-www-form-urlencoded<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>Request Body Parameters<\/h4>\n<table style=\"width: auto\">\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<th style=\"text-align:left;\">app<\/th>\n<td>Name of your application as provided by modulus&reg; team.<\/td>\n<\/tr>\n<tr>\n<th style=\"text-align:left;\">secret<\/th>\n<td>App secret as provided by modulus&reg; team.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>Responses<\/h4>\n<table style=\"width: auto;\">\n<thead>\n<tr>\n<th>HTTP Status<\/th>\n<th>result<\/th>\n<th>title<\/th>\n<th>message<\/th>\n<th>object<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<th colspan=\"5\">Success Responses<\/th>\n<\/tr>\n<tr>\n<td>200 OK<\/td>\n<td>true<\/td>\n<td>Success<\/td>\n<td>Authentication succeeded.<\/td>\n<td>\n<pre><code class=\"json\">{\r\n    \"token\": \"YOUR_TOKEN\",\r\n    \"app_id\": \"YOUR_APP_ID\",\r\n    \"ip\": \"AUTHENTICATED_IP_ADDRESS\"\r\n}<\/code><\/pre>\n<\/td>\n<\/tr>\n<tr>\n<th colspan=\"5\">Failure Responses<\/th>\n<\/tr>\n<tr>\n<td>400 Bad Request<\/td>\n<td>false<\/td>\n<td>Bad Request<\/td>\n<td>Missing one or more of parameters account, app, secret.<\/td>\n<td>null<\/td>\n<\/tr>\n<tr>\n<td>401 Unauthorized<\/td>\n<td>false<\/td>\n<td>Unauthorized<\/td>\n<td>Authentication failed.<\/td>\n<td>null<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Please note that authentication token expires 15 minutes after creation.<\/p>\n<h4>Example<\/h4>\n<table style=\"width: auto;\">\n<tbody>\n<tr>\n<th style=\"text-align:left\">Request<\/th>\n<td>\n<pre><code class=\"json\">curl --request POST 'https:\/\/your_account.modulus.biz\/api\/cmn\/Authenticate' \\\r\n--header 'Content-Type: application\/x-www-form-urlencoded' \\\r\n--data-urlencode 'app=YOUR_APP_NAME' \\\r\n--data-urlencode 'secret=SECRET_KEY'\r\n<\/code><\/pre>\n<\/td>\n<\/tr>\n<tr>\n<th colspan=\"2\">Success Responses<\/th>\n<\/tr>\n<tr>\n<th style=\"text-align:left\">200 OK<\/th>\n<td>\n<pre><code class=\"json\">{\r\n    \"result\": true,\r\n    \"title\": \"Success\",\r\n    \"message\": \"Authentication succeeded.\",\r\n    \"object\": {\r\n        \"token\": \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\r\n        \"app_id\": \"XXX\",\r\n        \"ip\": \"X.X.X.X\"\r\n    }\r\n}<\/code><\/pre>\n<\/td>\n<\/tr>\n<tr>\n<th colspan=\"2\">Failure Responses<\/th>\n<\/tr>\n<tr>\n<th style=\"text-align:left\">400 Bad Request<\/th>\n<td>\n<pre><code class=\"json\">{\r\n    \"result\": false,\r\n    \"title\": \"Bad Request\",\r\n    \"message\": \"Missing one or more of parameters account, app, secret.\",\r\n    \"object\": null\r\n}<\/code><\/pre>\n<\/td>\n<\/tr>\n<tr>\n<th style=\"text-align:left\">401 Unauthorized<\/th>\n<td>\n<pre><code class=\"json\">{\r\n    \"result\": false,\r\n    \"title\": \"Unauthorized\",\r\n    \"message\": \"Authentication failed.\",\r\n    \"object\": null\r\n}<\/code><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"featured_media":0,"parent":3432,"menu_order":1,"comment_status":"closed","ping_status":"closed","template":"","doc_tag":[],"comment_count":0,"_links":{"self":[{"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/docs\/3439"}],"collection":[{"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/comments?post=3439"}],"version-history":[{"count":27,"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/docs\/3439\/revisions"}],"predecessor-version":[{"id":4541,"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/docs\/3439\/revisions\/4541"}],"up":[{"embeddable":true,"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/docs\/3432"}],"next":[{"title":"Authentication JWT Token","link":"https:\/\/modulus.help\/kb\/docs\/documentation\/getting-started\/authentication-jwt-token\/","href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/docs\/4587"}],"prev":[{"title":"Create App","link":"https:\/\/modulus.help\/kb\/docs\/documentation\/getting-started\/step-1-create-app\/","href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/docs\/3438"}],"wp:attachment":[{"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/media?parent=3439"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/doc_tag?post=3439"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}