Skip to main content

Hi, I am Certified Salesforce Developer and looking to integrate salesforce with MTN momo through rest API. For initial Stages I am testing it in Sandbox and testing it in Postman about how the things are working.
I have got 2 keys in my Profile Primery Key and Secondary Key. Whenever I try to generate an access token in POST man it says :

{

    "statusCode": 401,

    "message": "Access denied due to invalid subscription key. Make sure to provide a valid key for an active subscription."

}
I have tried adding both keys in header with parameter : Ocp-Apim-Subscription-Key = Key.
I have subscriped the collection widget. 
IS the integration possible with salesforce?

Please subscribe to https://momodeveloper.mtn.com/product#product=collections   and use the primary key.

Do not use the Widget keys for now.  


Thanks for your reply!
I am still having issue with this, on postman it says: 

{

    "statusCode": 401,

    "message": "Access denied due to missing subscription key. Make sure to include subscription key when making requests to an API."

}

Can you tell me are my headers correct?
Authorization i have inserted my password

 


Two issues,

  1. In the postman request you are sending the headers as params, please fix this and send the headers from the headers tab. That is why your headers are not detected.
  2. Also the authorization header must be Authorization: Basic base64Encode(ApiUser:ApiKey) . Note the keyword Basic before the result of what you get when you base64Encode the string value of ApiUser:ApiKey

I can see, you are even using the wrong Authorization, just incase your authorization is not a POSTMAN variable.
The developer community has a lot of content and support.
Visit the home page, you will find pdfs, videos and power points that guide you,
However, if you still get stranded, kindly respond here then the community will guide you in a better way to simplify for you. 


Hi

Thanks for your reply!
I am still having issue with this, on postman it says: 

{

    "statusCode": 401,

    "message": "Access denied due to missing subscription key. Make sure to include subscription key when making requests to an API."

}

Can you tell me are my headers correct?
Authorization i have inserted my password

 

Hello.if you want to generate the access token, you are not supposed to pass those items as params. Only the Ocp-Apim-Subscription-key should be sent and as a header. For authorization, the type should be Basic Auth where username is x-reference-id and password is the API key. the url should end at collection/token


Reply