<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Missing property 'token' on type 'AbstractCredentialsResponseElement' in Developer Q&amp;A Forum</title>
    <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Missing-property-token-on-type/m-p/302099#M1704</link>
    <description>&lt;P&gt;We still experience the same issue, the token is always returning undefined, please find enclose code and results, I appreciate your support to resolve this issue:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CODE:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;const response = await credentialVaultClient.getCredentials&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;id: "CREDENTIALS_VAULT-1485306F4C9844D0"&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;) as CredentialsDetailsTokenResponseElement;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;console.log("token = ", response.token);&lt;/P&gt;&lt;P&gt;console.log("summary= ",response.credentialUsageSummary);&lt;/P&gt;&lt;P&gt;console.log("description= ",response.description);&lt;/P&gt;&lt;P&gt;console.log("externalVault = ",response.externalVault);&lt;/P&gt;&lt;P&gt;console.log("id = ",&lt;A href="http://response.id/" rel="noopener noreferrer nofollow" target="_blank"&gt;response.id&lt;/A&gt;);&lt;/P&gt;&lt;P&gt;console.log("name = ",&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://response.name/" rel="noopener noreferrer nofollow" target="_blank"&gt;response.name&lt;/A&gt;);&lt;/P&gt;&lt;P&gt;console.log("owner=",response.owner);&lt;/P&gt;&lt;P&gt;console.log("ownerAccessOnly = ", response.ownerAccessOnly);&lt;/P&gt;&lt;P&gt;console.log("scope = ",response.scope);&lt;/P&gt;&lt;P&gt;console.log("type = ", response.type);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;console.log(Object.keys(response));&lt;/P&gt;&lt;P&gt;console.log(JSON.stringify(response, null, 2));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RESULTS:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;token = undefined&lt;/P&gt;&lt;P&gt;summary= []&lt;/P&gt;&lt;P&gt;description= Rotating token&lt;/P&gt;&lt;P&gt;externalVault = null&lt;/P&gt;&lt;P&gt;id = CREDENTIALS_VAULT-1485306F4C9844D0&lt;/P&gt;&lt;P&gt;name = [t-d] DT-A Interface Rotating Token&lt;/P&gt;&lt;P&gt;owner=&lt;SPAN&gt;&amp;nbsp;mc@me.com&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;ownerAccessOnly = false&lt;/P&gt;&lt;P&gt;scope = APP_ENGINE&lt;/P&gt;&lt;P&gt;type = TOKEN&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;"name",&lt;/P&gt;&lt;P&gt;"id",&lt;/P&gt;&lt;P&gt;"description",&lt;/P&gt;&lt;P&gt;"owner",&lt;/P&gt;&lt;P&gt;"ownerAccessOnly",&lt;/P&gt;&lt;P&gt;"scope",&lt;/P&gt;&lt;P&gt;"externalVault",&lt;/P&gt;&lt;P&gt;"credentialUsageSummary",&lt;/P&gt;&lt;P&gt;"scopes",&lt;/P&gt;&lt;P&gt;"allowedEntities",&lt;/P&gt;&lt;P&gt;"allowContextlessRequests",&lt;/P&gt;&lt;P&gt;"type"&lt;/P&gt;&lt;P&gt;]&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;"name": "[t-d] DT-A Interface Rotating Token",&lt;/P&gt;&lt;P&gt;"id": "CREDENTIALS_VAULT-1485306F4C9844D0",&lt;/P&gt;&lt;P&gt;"description": "Rotating token",&lt;/P&gt;&lt;P&gt;"owner": "mc@me.com",&lt;/P&gt;&lt;P&gt;"ownerAccessOnly": false,&lt;/P&gt;&lt;P&gt;"scope": "APP_ENGINE",&lt;/P&gt;&lt;P&gt;"externalVault": null,&lt;/P&gt;&lt;P&gt;"credentialUsageSummary": [],&lt;/P&gt;&lt;P&gt;"scopes": [&lt;/P&gt;&lt;P&gt;"APP_ENGINE"&lt;/P&gt;&lt;P&gt;],&lt;/P&gt;&lt;P&gt;"allowedEntities": [],&lt;/P&gt;&lt;P&gt;"allowContextlessRequests": false,&lt;/P&gt;&lt;P&gt;"type": "TOKEN"&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;</description>
    <pubDate>Sat, 18 Jul 2026 16:52:43 GMT</pubDate>
    <dc:creator>MarwanC</dc:creator>
    <dc:date>2026-07-18T16:52:43Z</dc:date>
    <item>
      <title>Missing property 'token' on type 'AbstractCredentialsResponseElement'</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Missing-property-token-on-type/m-p/216911#M378</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;
&lt;P&gt;I tried to use &lt;CODE&gt;credentialVaultClient&lt;/CODE&gt; to retrieve a token stored in the credentials vault. It seems like the property &lt;CODE&gt;token&lt;/CODE&gt; is missing on the type &lt;CODE&gt;AbstractCredentialsResponseElement&lt;/CODE&gt;. Also, I need to copy the response to get the token.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;	private getToken = () =&amp;gt; {
		const resp = credentialVaultClient.getCredentialsDetails({
			id: dynatraceConfig['API_TOKEN'][this.environmentId][this.env],
		});
		const respCopy: any = { ...resp };
		return respCopy.token;
	};&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is my &lt;CODE&gt;package.json&lt;/CODE&gt;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;"dependencies": {
    "@dynatrace-sdk/app-environment": "^1.0.0",
    "@dynatrace-sdk/app-utils": "^0.2.2",
    "@dynatrace-sdk/client-classic-environment-v2": "^1.1.0",
    "@dynatrace-sdk/client-query": "1.2.0",
    "@dynatrace-sdk/error-handlers": "1.1.0",
    "@dynatrace-sdk/navigation": "1.0.0",
    "@dynatrace-sdk/user-preferences": "1.0.0",
    "@dynatrace/strato-components-preview": "0.97.1",
    "@hookform/resolvers": "^3.1.1",
    "joi": "^17.9.2",
    "react": "^17.0.0",
    "react-dom": "^17.0.0",
    "react-hook-form": "^7.45.1",
    "react-router-dom": "^6.4.1"
  }&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please advise. Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2023 16:50:54 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Missing-property-token-on-type/m-p/216911#M378</guid>
      <dc:creator>StephenLHChan</dc:creator>
      <dc:date>2023-07-04T16:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: Missing property 'token' on type 'AbstractCredentialsResponseElement'</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Missing-property-token-on-type/m-p/216919#M379</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/59527"&gt;@StephenLHChan&lt;/a&gt;,&amp;nbsp;&lt;CODE&gt;credentialVaultClient.getCredentialsDetails&lt;/CODE&gt;&amp;nbsp;is an asynchronous function, which means it returns a &lt;CODE&gt;Promise&lt;/CODE&gt;. To properly handle this, you should use &lt;CODE&gt;async/await&lt;/CODE&gt;, something like this should work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;import {
  CredentialsDetailsTokenResponseElement,
  credentialVaultClient,
} from "@dynatrace-sdk/client-classic-environment-v2";

//...

private async getToken = () =&amp;gt; {
  const resp = await credentialVaultClient.getCredentialsDetails({
    id: dynatraceConfig['API_TOKEN'][this.environmentId][this.env],
  }) as CredentialsDetailsTokenResponseElement;

  return resp.token;
};&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Notice the keywords&amp;nbsp;&lt;CODE&gt;async&lt;/CODE&gt; in the function declaration and &lt;CODE&gt;await&lt;/CODE&gt; right before the call to the credentials vault. Besides that, notice that I added a type assertion &lt;CODE&gt;as CredentialsDetailsTokenResponseElement&lt;/CODE&gt;, which allows you to properly access &lt;CODE&gt;resp.token&lt;/CODE&gt;. The reason for this is that depending on the type of the credential, the response will be of a concrete type or another (instead of just&amp;nbsp;&lt;CODE&gt;AbstractCredentialsResponseElement&lt;/CODE&gt;), containing different sets of fields. You can see all the different types&amp;nbsp;&lt;A href="https://developer.dynatrace.com/reference/sdks/client-classic-environment-v2/#abstractcredentialsresponseelementtype" target="_self"&gt;in the SDK reference&lt;/A&gt;&amp;nbsp;in the Dynatrace Developer portal.&lt;/P&gt;
&lt;P&gt;Some additional resources:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Promises:&amp;nbsp;&lt;A href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise" target="_blank"&gt;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;async/await:&amp;nbsp;&lt;A href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function" target="_blank"&gt;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Type assertions:&amp;nbsp;&lt;A href="https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#type-assertions" target="_blank"&gt;https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#type-assertions&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Tue, 04 Jul 2023 16:46:52 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Missing-property-token-on-type/m-p/216919#M379</guid>
      <dc:creator>educampver</dc:creator>
      <dc:date>2023-07-04T16:46:52Z</dc:date>
    </item>
    <item>
      <title>Re: Missing property 'token' on type 'AbstractCredentialsResponseElement'</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Missing-property-token-on-type/m-p/302099#M1704</link>
      <description>&lt;P&gt;We still experience the same issue, the token is always returning undefined, please find enclose code and results, I appreciate your support to resolve this issue:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CODE:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;const response = await credentialVaultClient.getCredentials&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;id: "CREDENTIALS_VAULT-1485306F4C9844D0"&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;) as CredentialsDetailsTokenResponseElement;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;console.log("token = ", response.token);&lt;/P&gt;&lt;P&gt;console.log("summary= ",response.credentialUsageSummary);&lt;/P&gt;&lt;P&gt;console.log("description= ",response.description);&lt;/P&gt;&lt;P&gt;console.log("externalVault = ",response.externalVault);&lt;/P&gt;&lt;P&gt;console.log("id = ",&lt;A href="http://response.id/" rel="noopener noreferrer nofollow" target="_blank"&gt;response.id&lt;/A&gt;);&lt;/P&gt;&lt;P&gt;console.log("name = ",&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://response.name/" rel="noopener noreferrer nofollow" target="_blank"&gt;response.name&lt;/A&gt;);&lt;/P&gt;&lt;P&gt;console.log("owner=",response.owner);&lt;/P&gt;&lt;P&gt;console.log("ownerAccessOnly = ", response.ownerAccessOnly);&lt;/P&gt;&lt;P&gt;console.log("scope = ",response.scope);&lt;/P&gt;&lt;P&gt;console.log("type = ", response.type);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;console.log(Object.keys(response));&lt;/P&gt;&lt;P&gt;console.log(JSON.stringify(response, null, 2));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RESULTS:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;token = undefined&lt;/P&gt;&lt;P&gt;summary= []&lt;/P&gt;&lt;P&gt;description= Rotating token&lt;/P&gt;&lt;P&gt;externalVault = null&lt;/P&gt;&lt;P&gt;id = CREDENTIALS_VAULT-1485306F4C9844D0&lt;/P&gt;&lt;P&gt;name = [t-d] DT-A Interface Rotating Token&lt;/P&gt;&lt;P&gt;owner=&lt;SPAN&gt;&amp;nbsp;mc@me.com&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;ownerAccessOnly = false&lt;/P&gt;&lt;P&gt;scope = APP_ENGINE&lt;/P&gt;&lt;P&gt;type = TOKEN&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;"name",&lt;/P&gt;&lt;P&gt;"id",&lt;/P&gt;&lt;P&gt;"description",&lt;/P&gt;&lt;P&gt;"owner",&lt;/P&gt;&lt;P&gt;"ownerAccessOnly",&lt;/P&gt;&lt;P&gt;"scope",&lt;/P&gt;&lt;P&gt;"externalVault",&lt;/P&gt;&lt;P&gt;"credentialUsageSummary",&lt;/P&gt;&lt;P&gt;"scopes",&lt;/P&gt;&lt;P&gt;"allowedEntities",&lt;/P&gt;&lt;P&gt;"allowContextlessRequests",&lt;/P&gt;&lt;P&gt;"type"&lt;/P&gt;&lt;P&gt;]&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;"name": "[t-d] DT-A Interface Rotating Token",&lt;/P&gt;&lt;P&gt;"id": "CREDENTIALS_VAULT-1485306F4C9844D0",&lt;/P&gt;&lt;P&gt;"description": "Rotating token",&lt;/P&gt;&lt;P&gt;"owner": "mc@me.com",&lt;/P&gt;&lt;P&gt;"ownerAccessOnly": false,&lt;/P&gt;&lt;P&gt;"scope": "APP_ENGINE",&lt;/P&gt;&lt;P&gt;"externalVault": null,&lt;/P&gt;&lt;P&gt;"credentialUsageSummary": [],&lt;/P&gt;&lt;P&gt;"scopes": [&lt;/P&gt;&lt;P&gt;"APP_ENGINE"&lt;/P&gt;&lt;P&gt;],&lt;/P&gt;&lt;P&gt;"allowedEntities": [],&lt;/P&gt;&lt;P&gt;"allowContextlessRequests": false,&lt;/P&gt;&lt;P&gt;"type": "TOKEN"&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jul 2026 16:52:43 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Missing-property-token-on-type/m-p/302099#M1704</guid>
      <dc:creator>MarwanC</dc:creator>
      <dc:date>2026-07-18T16:52:43Z</dc:date>
    </item>
  </channel>
</rss>

