{"id":4587,"date":"2025-11-17T12:15:43","date_gmt":"2025-11-17T10:15:43","guid":{"rendered":"https:\/\/modulus.help\/kb\/?post_type=docs&#038;p=4587"},"modified":"2025-11-17T12:18:21","modified_gmt":"2025-11-17T10:18:21","slug":"authentication-jwt-token","status":"publish","type":"docs","link":"https:\/\/modulus.help\/kb\/docs\/documentation\/getting-started\/authentication-jwt-token\/","title":{"rendered":"Authentication JWT 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\u00ae 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>AuthenticateToken<\/td>\n<\/tr>\n<tr>\n<th style=\"text-align: left;\">URL<\/th>\n<td>https:\/\/your_account.modulus.biz\/api\/cmn\/AuthenticateToken<\/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\u00ae Server<\/td>\n<\/tr>\n<tr>\n<th style=\"text-align: left;\">Content Type<\/th>\n<td>Application\/Json<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>Request Body<\/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;\">Username<\/th>\n<td>Username of the user that has permission to call the needed endpoint.<\/td>\n<\/tr>\n<tr>\n<th style=\"text-align: left;\">Password<\/th>\n<td>The password of the user.<\/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\"> {\n\"result\": true,\n\"title\": \"Success\",\n\"message\": \"Authentication succeeded.\",\n\"object\": \"XXXXXXXXXX\"\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>\n<div>\n<div>Missing one or more of parameters: username and password.<\/div>\n<\/div>\n<\/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>Request<\/th>\n<td>\n<pre><code class=\"json\">curl --request POST 'https:\/\/your_account.modulus.biz\/api\/cmn\/AuthenticateToken' \\\n--header 'Content-Type: application\/json' \\\n--data '{\"username\": YOUR_USER_NAME, \"password\": YOUR_PASSWORD}'\n<\/code><\/pre>\n<\/td>\n<\/tr>\n<tr>\n<th colspan=\"2\">Success Responses<\/th>\n<\/tr>\n<tr>\n<th>200 OK<\/th>\n<td>\n<pre><code class=\"json\">{\n    \"result\": true,\n    \"title\": \"Success\",\n    \"message\": \"Authentication succeeded.\",\n    \"object\": \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"\n}<\/code><\/pre>\n<\/td>\n<\/tr>\n<tr>\n<th colspan=\"2\">Failure Responses<\/th>\n<\/tr>\n<tr>\n<th>400 Bad Request<\/th>\n<td>\n<pre><code class=\"json\">{\n    \"result\": false,\n    \"title\": \"Bad Request\",\n    \"message\": \"Missing one or more of parameters username and password.\",\n    \"object\": null\n}<\/code><\/pre>\n<\/td>\n<\/tr>\n<tr>\n<th>401 Unauthorized<\/th>\n<td>\n<pre><code class=\"json\">{\n    \"result\": false,\n    \"title\": \"Unauthorized\",\n    \"message\": \"Authentication failed.\",\n    \"object\": null\n}<\/code><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"featured_media":0,"parent":3432,"menu_order":2,"comment_status":"closed","ping_status":"closed","template":"","doc_tag":[],"comment_count":0,"_links":{"self":[{"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/docs\/4587"}],"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=4587"}],"version-history":[{"count":7,"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/docs\/4587\/revisions"}],"predecessor-version":[{"id":4595,"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/docs\/4587\/revisions\/4595"}],"up":[{"embeddable":true,"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/docs\/3432"}],"next":[{"title":"API Call &amp; Common Responses","link":"https:\/\/modulus.help\/kb\/docs\/documentation\/getting-started\/step-3-api-call\/","href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/docs\/3440"}],"prev":[{"title":"Authentication Token","link":"https:\/\/modulus.help\/kb\/docs\/documentation\/getting-started\/step-2-authentication-token\/","href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/docs\/3439"}],"wp:attachment":[{"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/media?parent=4587"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/doc_tag?post=4587"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}