{"id":348,"date":"2023-02-07T12:17:14","date_gmt":"2023-02-07T12:17:14","guid":{"rendered":"https:\/\/devdocs.resales-online.com\/index.php\/docs\/new-development-updates-api\/authentication\/retrieve-a-token\/"},"modified":"2023-02-13T12:28:39","modified_gmt":"2023-02-13T12:28:39","slug":"retrieve-a-token","status":"publish","type":"docs","link":"https:\/\/devdocs.resales-online.com\/index.php\/docs\/new-development-updates-api\/authentication\/retrieve-a-token\/","title":{"rendered":"Retrieve a token"},"content":{"rendered":"\n<p>Get a new OAuth2 token for the current client. This is the only request that do not accept a JSON body and do not require an access token. This also the only request that you <strong>must not<\/strong> including the <code>Content-Type: application\/json<\/code> header.<\/p>\n\n\n\n<p><\/p>\n\n\n<div >\n        <div class=\" plethoraplugins-tabs-container plethoraplugins-tabs-container--horizontal plethoraplugins-theme__minimal plethoraplugins-theme__basic \" \n\t\t\tdata-pds-tabs--layout=\"horizontal\"  \n\t\t\tdata-pds-tabs--theme=\"basic\"  \n\t\t\tdata-pds-tabs--mobile-breakpoint-forced=\"\"\n\t\t\t data-pds-tabs--responsive=\"accordion\" \n\t\t\t\t\t data-pds-tabs--responsive-accordion-collapsed-initially=\"false\" data-pds-tabs--accordion-icon-type=\"\" data-pds-tabs--accordion-icon=\"true\"  data-pds-tabs--accordion-icon-size=\"\"  data-pds-tabs--accordion-heading-level=\"h3\" data-pds-tabs--accordion-auto-close=\"true\" >\n            <div class=\"plethoraplugins-tabs\"  >\n              <ul><li>\n                        <a \n                                href=\"#request\"\n                                class=\" active\" \n                            >\n                            <span>Request<\/span>\n                        <\/a>\n                    <\/li><li>\n                        <a \n                                href=\"#200_response\"\n                                class=\"\" \n                            >\n                            <span>200 Response<\/span>\n                        <\/a>\n                    <\/li><li>\n                        <a \n                                href=\"#400_response\"\n                                class=\"\" \n                            >\n                            <span>400 Response<\/span>\n                        <\/a>\n                    <\/li><li>\n                        <a \n                                href=\"#401_response\"\n                                class=\"\" \n                            >\n                            <span>401 Response<\/span>\n                        <\/a>\n                    <\/li><\/ul>\n            <\/div>\n            <div class=\"plethoraplugins-tabs--content\" >\n                \n<div class=\"\"  data-pds-tabs--accordion-initially-open=\"false\" >\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n<p>REQUEST BODY SCHEMA: application\/x-www-form-urlencoded<\/p>\n\n\n\n<p>END POINT: <code>https:\/\/api.propq.com\/oauth\/token<\/code><\/p>\n\n\n\n<p>METHOD: <code>POST<\/code><\/p>\n\n\n\n<p>PARAMS: <\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><em><strong>name<\/strong><\/em><\/td><td><em><strong>required<\/strong><\/em><\/td><td><em><strong>type<\/strong><\/em><\/td><td><strong><em>Value<\/em><\/strong><\/td><\/tr><tr><td>grant_type<\/td><td><em>required<\/em><\/td><td>string<\/td><td>Value: &#8220;<strong><em><em><code>client_credentials<\/code><\/em><\/em><\/strong>&#8220;<br><em>Currently, we only support client credentials flow, the value always be <code>client_credentials<\/code><\/em><\/td><\/tr><tr><td>client_id<\/td><td><em>required<\/em><\/td><td>number<\/td><td>The client id number<\/td><\/tr><tr><td>client_secret<\/td><td><em>required<\/em><\/td><td>string<\/td><td>The client secret key<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><\/p>\n<\/div>\n<\/div>\n\n<\/div>\n\n<div class=\"\"  data-pds-tabs--accordion-initially-open=\"false\" >\n\n<p>RESPONSE SCHEMA: <code>application\/json<\/code><\/p>\n\n\n\n<p>RESPONSE STATUS CODE: <code>200<\/code><\/p>\n\n\n\n<p>RESPONSE STATUS: <code>SUCCESS<\/code><\/p>\n\n\n\n<p>BODY OUTPUT:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-json\" data-lang=\"JSON\"><code>{\n  &quot;token_type&quot;: &quot;Bearer&quot;,\n  &quot;expires_in&quot;: 7200,\n  &quot;access_token&quot;: &quot;eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0&quot;\n}<\/code><\/pre><\/div>\n\n<\/div>\n\n<div class=\"\"  data-pds-tabs--accordion-initially-open=\"false\" >\n\n<p>RESPONSE SCHEMA: <code>application\/json<\/code><\/p>\n\n\n\n<p>RESPONSE STATUS CODE: <code>400<\/code><\/p>\n\n\n\n<p>RESPONSE STATUS: <code> Bad request.<\/code><\/p>\n\n\n\n<p>BODY OUTPUT:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-json\" data-lang=\"JSON\"><code>{\n    &quot;error&quot;: &quot;invalid_request&quot;,\n    &quot;message&quot;: &quot;The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed.&quot;,\n    &quot;hint&quot;: &quot;Check the `client_id` parameter&quot;\n}<\/code><\/pre><\/div>\n\n<\/div>\n\n<div class=\"\"  data-pds-tabs--accordion-initially-open=\"false\" >\n\n<p>RESPONSE SCHEMA: <code>application\/json<\/code><\/p>\n\n\n\n<p>RESPONSE STATUS CODE: <code>40<\/code>1<\/p>\n\n\n\n<p>RESPONSE STATUS: <code> Unauthorized.<\/code><\/p>\n\n\n\n<p>BODY OUTPUT:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-json\" data-lang=\"JSON\"><code>{\n    &quot;error&quot;: &quot;invalid_client&quot;,\n    &quot;message&quot;: &quot;Client authentication failed&quot;\n}<\/code><\/pre><\/div>\n\n<\/div>\n\n            <\/div>\n        <\/div>\n        \n    <\/div>\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"featured_media":0,"parent":327,"menu_order":1,"comment_status":"closed","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-348","docs","type-docs","status-publish","hentry"],"comment_count":0,"_links":{"self":[{"href":"https:\/\/devdocs.resales-online.com\/index.php\/wp-json\/wp\/v2\/docs\/348","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devdocs.resales-online.com\/index.php\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/devdocs.resales-online.com\/index.php\/wp-json\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/devdocs.resales-online.com\/index.php\/wp-json\/wp\/v2\/comments?post=348"}],"version-history":[{"count":14,"href":"https:\/\/devdocs.resales-online.com\/index.php\/wp-json\/wp\/v2\/docs\/348\/revisions"}],"predecessor-version":[{"id":387,"href":"https:\/\/devdocs.resales-online.com\/index.php\/wp-json\/wp\/v2\/docs\/348\/revisions\/387"}],"up":[{"embeddable":true,"href":"https:\/\/devdocs.resales-online.com\/index.php\/wp-json\/wp\/v2\/docs\/327"}],"wp:attachment":[{"href":"https:\/\/devdocs.resales-online.com\/index.php\/wp-json\/wp\/v2\/media?parent=348"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/devdocs.resales-online.com\/index.php\/wp-json\/wp\/v2\/doc_tag?post=348"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}