{"id":6310,"date":"2025-07-03T11:34:03","date_gmt":"2025-07-03T11:34:03","guid":{"rendered":"https:\/\/support.alfaview.com\/?page_id=6310"},"modified":"2025-07-03T11:36:24","modified_gmt":"2025-07-03T11:36:24","slug":"initial-authentication-with-username-password","status":"publish","type":"page","link":"https:\/\/cp-prod-wordpress.alfa.sx\/de\/developers\/request-your-api-credentials\/usage-examples\/initial-authentication-with-username-password\/","title":{"rendered":"Erstauthentifizierung mit Benutzername\/Passwort"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"summary\">Summary<a href=\"#summary\" class=\"av-heading-anchor\"><i class=\"bi bi-link\"><\/i><\/a><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Creates an access token which can be used throughout the process<\/li>\n\n\n\n<li>Can be checked for expiry<\/li>\n\n\n\n<li><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\"><code>companyId<\/code><\/mark> is optional, API response contains all accessible <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\"><code>companyId<\/code><\/mark>s<\/li>\n\n\n\n<li>Required API calls: <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\"><code>authenticationService\/authenticate<\/code><\/mark><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"request\">Request<a href=\"#request\" class=\"av-heading-anchor\"><i class=\"bi bi-link\"><\/i><\/a><\/h2>\n\n\n\n<p>Request <button class=\"av-button av-button--error\">POST<\/button> to <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\"><code>https:\/\/apis.alfaview.com\/json\/v1\/authenticationService\/authenticate<\/code><\/mark><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"requestId\": \"### REQUEST ID ###\",\n  \"usernamePasswordCredentials\": {\n  \"username\": \"### USERNAME ###\",\n  \"password\": \"### PASSWORD ###\",\n  \"companyId\": \"### COMPANY ID ###\"\n  }\n}\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"response\">Response<a href=\"#response\" class=\"av-heading-anchor\"><i class=\"bi bi-link\"><\/i><\/a><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  ...\n  \"accessToken\": \"...\",\n  \"expiresAt\": \"...\",\n  ...\n}\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"notes\">Notes<a href=\"#notes\" class=\"av-heading-anchor\"><i class=\"bi bi-link\"><\/i><\/a><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Store the access token for subsequent requests<\/li>\n\n\n\n<li>Remember to re-authenticate before <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\"><code>expiresAt<\/code><\/mark> timestamp, or you will receive an error that the token has expired<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Summary Creates an access token which can be used throughout the process Can be checked for expiry companyId is optional, API response contains all accessible companyIds Required API calls: authenticationService\/authenticate Request Request POST to https:\/\/apis.alfaview.com\/json\/v1\/authenticationService\/authenticate [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":0,"parent":3170,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-6310","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/cp-prod-wordpress.alfa.sx\/de\/wp-json\/wp\/v2\/pages\/6310","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cp-prod-wordpress.alfa.sx\/de\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/cp-prod-wordpress.alfa.sx\/de\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/cp-prod-wordpress.alfa.sx\/de\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/cp-prod-wordpress.alfa.sx\/de\/wp-json\/wp\/v2\/comments?post=6310"}],"version-history":[{"count":2,"href":"https:\/\/cp-prod-wordpress.alfa.sx\/de\/wp-json\/wp\/v2\/pages\/6310\/revisions"}],"predecessor-version":[{"id":6311,"href":"https:\/\/cp-prod-wordpress.alfa.sx\/de\/wp-json\/wp\/v2\/pages\/6310\/revisions\/6311"}],"up":[{"embeddable":true,"href":"https:\/\/cp-prod-wordpress.alfa.sx\/de\/wp-json\/wp\/v2\/pages\/3170"}],"wp:attachment":[{"href":"https:\/\/cp-prod-wordpress.alfa.sx\/de\/wp-json\/wp\/v2\/media?parent=6310"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}