Any POST or GET requests from the Revue API return 401

Viewed 397

I am trying to add subscribers to my newsletter using the Revue api. According to the documentation, I need to add a header called 'Authorization' and value 'Token MY-TOKEN' in my requests.

In order to test out the API I am using Postman as seen in the screenshot below:

enter image description here

Any request I do to any url, ends up with a 401.

What am I missing here? The token value is copy pasted from the bottom of https://www.getrevue.co/app/integrations ('Your API key is xyz') as the documentation mentions. Double checked that there are no extra spaces added.

2 Answers

You cannot use the API (or at least certain entry points) without first verifying your account

If you fail to do this, your requests end with a 401 status.

Verify your account

There is no explicit option to verify your account. Instead, you need to import an existing mailing list. If you don't have a list to import, you can enforce this step by creating an artificial list, containing just your email. To do so, visit your Revue dashboard, Subscribers section, and click "Import from file":

enter image description here.

Then, enter your email and two commas to skip your first and last name:

enter image description here

Submit and fill the next form.

When completed, a top ribbon indicates that the review is on its way:

enter image description here

You need to wait for the review to be completed.

Perform a request

To get your API key, visit your Revue dashboard, Account settings, Integrations, and scroll down to the bottom of the page:

enter image description here

Run something like:

const revueApiKey = "[your API key]";
const result = await fetch('https://www.getrevue.co/api/v2/subscribers', {
  method: 'POST',
  headers: {
    Authorization: `Token ${revueApiKey}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ email: "john@example.com", double_opt_in: false })
});

If you have the following when you log in to Revue

"We are reviewing your account."

You will not be able to make API calls and will get a 401.

I've talked to support on the issue and unfortunately, it's undocumented at the moment.

getrevue dashboard "we are reviewing your account"

Took nearly a week for me to get reviewed but it's working fine now. It is at the end of the Christmas period so I am hoping they are only temporarily that slow at reviewing accounts.

Related