Authentication
SwervePay Rest API utilizes the following base URL:
https://api.swervepay.com/v/2.0/{accountSid}/
The {accountSid}
in the above URL is specific to your account and will always be available within the My Account page when you log into the SwervePay account. If API Information section is not found on the My Account page, please contact your SwervePay support representative to request API access for your account.
Security for the SwervePay Rest API is achieved through HTTP basic access authentication. Basic access authentication is achieved by providing a base64 encoding of your username and secure API key in an Authorization: Basic header within your HTTP request.
An example of basic access authentication using a username and API key is shown below.
Basic access authentication:
Assumptions:
Username: myusername
API key: 221b368d7f5f597867f525971f28ff75
To generate the appropriate basic access authentication header, you need base64 to encode the following string:
myusername:221b368d7f5f597867f525971f28ff75
Resulting the following HTTP header being submitted with each request:
Authorization: Basic bXl1c2VybmFtZToyMjFiMzY4ZDdmNWY1OTc4NjdmNTI1OTcxZjI4ZmY3NQ==
The above values provided are only for an example. The actual authentication header will be derived from your own username and API key.
- API key can be generated from My Account page when you logged into your SwervePay account.
- The key can only be viewable when it is generated, so be sure to store it securely.
- There is no mechanism to retrieve the stored key once you have left the key generation screen.
- You can regenerate a new key if it becomes lost or compromised.
Note: Regenerating your API key will instantly cause all existing automation using your prior key to fail authentication until the applications have been updated with the newly generated key.
Updated over 2 years ago