ElasticEmail / ElasticEmail.WebApiClient-js

Deprecated library. Easily send emails with Elastic Email using Web API JS Client https://elasticemail.com/
MIT License
15 stars 9 forks source link

"Access Denied" comes up when requested through the issued api key. #10

Closed PaDuckk closed 4 years ago

PaDuckk commented 4 years ago

initialized the client with the newly issued hot Apikey.

import ee from 'elasticemail-webapiclient'

const onlyViewApikey =
  'B0A437740E95AE435073F101F72D63CC240803CA4C3DA91B8A5B5396236FEB2D4A30EB05543BF8018CD5CBDD52391FEA'
const options = {
  apiKey: onlyViewApikey,
  apiUri: 'https://api.elasticemail.com/',
  apiVersion: 'v2'
}

const EE = new ee(options)

// Load account data
EE.Account.Load()
  .then(function(resp) {
    console.log(resp.data)
  })
  .catch(error => {
    console.log(error)
  })

The response result I received is "access Denied".

why.. help me thank you

below is the response I received.

...
    [Symbol(kNeedDrain)]: false,
    [Symbol(isCorked)]: false,
    [Symbol(kOutHeaders)]: [Object: null prototype] {
      accept: [Array],
      'content-type': [Array],
      'user-agent': [Array],
      host: [Array]
    }
  },
  data: { success: false, error: 'Access Denied.' }
}
Access Denied.