What Is an Access Token?
The Access Token is needed in every request sent to the system in order to validate the sending user.
Request Structure
Method: POST
Endpoint: https://sandbox.interswitchng.com/passport/oauth/token
Request Body/Payload: “grant_type”:”client_credentials”
Request Headers (as Key:Value pairs):
- Content-Type : application/x-www-form-urlencoded
- Authorization : Basic SUtJQTgzQkREMEI2NTlFMzUzQTI4OUQ1QUQ1QUQ5NzkzNjYwOERENzUwNzI6OHEwUzVWd2tRMHZwV01BNFJqRXZuc0Z0NWsyK0V0elExZkRiM1dPRS80OD0=
where Authorization is Base64(clientID:SecretKey). For example in the above request
Base64(IKIA9614B82064D632E9B6418DF358A6A4AEA84D7218:XCTiBtLy1G9chAnyg0z3BcaFK4cVpwDg/GTw2EmjTZ8=) —– SUtJQTk2MTRCODIwNjRENjMyRTlCNjQxOERGMzU4QTZBNEFFQTg0RDcyMTg6WENUaUJ0THkxRzljaEFueWcwejNCY2FGSzRjVnB3RGcvR1R3MkVtalRaOD0=
Find sample response below
The expires_in field represents how long before the token expires (in seconds).