Struggling with error: The Mashery account associated with this request is not active, or an invalid

SOLVED
Go to solution
Occasional Participant

Struggling with error: The Mashery account associated with this request is not active, or an invalid

My code is here and is fairly standard:

 



headers = { "Authorization": "Bearer xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx", "X-Originating-IP": "###.##.##.###", "Content-Type": "application/json" } data = urllib.parse.urlencode({ # Request parameters 'status': 'ACTIVE', 'limit': 500, }) constantContactURL = "https://api.constantcontact.com/v2/contacts?status=ACTIVE&limit=500&api-key=X" constantContactData = s.get(constantContactURL, headers=headers)

I believe I'm passing the correct API Key and token, but I'm still getting:

 

 

The Mashery account associated with this request is not active, or an invalid API key was used.

The API Key and token both work in the test console on the Constant Contact API web portal, so I just can't understand what's happening with my code.

 

 

1 ACCEPTED SOLUTION
Moderator

Hi @IrishArts,

 

Thank you for reaching out to Constant Contact's API Support.

 

I hope this is a simple solution. Based on what you posted it looks like a syntax error. Your parameter for the API Key looks incorrect. You have api-key and it should be api_key.


Regards,
Jimmy D.
Tier II API Support Engineer

View solution in original post

1 REPLY 1
Moderator

Hi @IrishArts,

 

Thank you for reaching out to Constant Contact's API Support.

 

I hope this is a simple solution. Based on what you posted it looks like a syntax error. Your parameter for the API Key looks incorrect. You have api-key and it should be api_key.


Regards,
Jimmy D.
Tier II API Support Engineer

View solution in original post

Developer Portal

View API documentation, code samples, get your API key.

Visit Page