To make an API call to mpesa api, you will need to authenticate your app. Safaricom have provided an OAuth API for you to generate an access token, it supports client_credentials grant type. To authorize your API call to the OAuth API, you will need a Basic Auth over HTTPS authorization token. The Basic Auth string is a base64 encoded string of your app’s client key and client secret.
There is need to use a base64 library to build the gem to get the Basic Auth string that you will then use to invoke mpesa's OAuth API to get an access token.
Checkout the documentation here
To make an API call to mpesa api, you will need to authenticate your app. Safaricom have provided an OAuth API for you to generate an access token, it supports client_credentials grant type. To authorize your API call to the OAuth API, you will need a Basic Auth over HTTPS authorization token. The Basic Auth string is a base64 encoded string of your app’s client key and client secret. There is need to use a base64 library to build the gem to get the Basic Auth string that you will then use to invoke mpesa's OAuth API to get an access token. Checkout the documentation here