API Key MidServer Postman Error: invalid key prefix

Anirban5
Tera Contributor

Hello

 

I am trying to use API key based authentication to push events in MidServer. Basic authentication works fine. But when I try to change it to API key based i get the following error in postman output.

What is the Key Prefix ? As per documentation it is Authorization: Key <API Key> . My API Key Name is XXXX_API_Key_SandBox. So shouldn't it be Authorization: XXXX_API_Key_SandBox blahblahblahAPIkey

 

{
"servlet":"org.glassfish.jersey.servlet.ServletContainer-738862b5",
"message":"invalid key prefix in Authorization header (prefix should be &apos;Key&apos; followed by a whitespace and the API Key)",
"url":"/api/mid/em/inbound_event",
"status":"401"
}

 

Not sure what I am doing wrong in the payload

 

Some screenshots

Anirban5_0-1686033051730.png

Anirban5_2-1686033586781.png

 

Anirban5_3-1686033763481.png

 

 

 

From Postman header

Anirban5_1-1686033419235.png

 

 

1 ACCEPTED SOLUTION

Karan Chhabra6
Mega Sage
Mega Sage

Hi @Anirban5 ,

 

The Authorization header value should be Apikey b8ee.... or Key b8ee....

 

If my answer has helped with your question, please mark it as correct and helpful

 

Thanks!

View solution in original post

3 REPLIES 3

Karan Chhabra6
Mega Sage
Mega Sage

Hi @Anirban5 ,

 

The Authorization header value should be Apikey b8ee.... or Key b8ee....

 

If my answer has helped with your question, please mark it as correct and helpful

 

Thanks!

@Karan Chhabra6 @Anirban5 For some reason my API key contains wired charter like ﷞﷟﷒. Any idea what might be the issue?

That usually means the record has been imported as XML from another instance, as the APIKey field is an encrypted 'password2' field and doesn't transfer between instances without getting garbled.