https://github.com/ajamous/response-codes-api-client
https://github.com/ajamous/response-codes-api-client
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ajamous/response-codes-api-client
- Owner: ajamous
- Created: 2023-12-12T11:29:01.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-12T11:42:15.000Z (over 2 years ago)
- Last Synced: 2025-07-30T03:55:59.099Z (11 months ago)
- Language: JavaScript
- Size: 369 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Response Codes API Client
This is a client library for interacting with the Response Codes API, providing easy access to SMPP, HTTP, and SIP error codes and their descriptions.
## Installation
Install the package using npm:
```bash
npm install response-codes-api-client
```
## Usage
Here's how you can use the library:
```javascript
const responseCodesClient = require('response-codes-api-client');
async function getCodes() {
try {
// Fetch all SMPP error codes
const smppCodes = await responseCodesClient.getAllSMPPErrorCodes();
console.log(smppCodes);
// Fetch a specific HTTP error code description
const httpCodeDesc = await responseCodesClient.getHTTPResponseCodeDescription(404);
console.log(httpCodeDesc);
// Similarly, use other available functions
// ...
} catch (error) {
console.error(error);
}
}
getCodes();
```
## API
`getAllSMPPErrorCodes()`
Fetches all SMPP error codes.
`getSMPPErrorCodeDescription(errorCode)`
Fetches the description for a specific SMPP error code.
`errorCode` (int): The specific SMPP error code.
`getAllHTTPResponseCodes()`
Fetches all HTTP response codes.
`getHTTPResponseCodeDescription(code)`
Fetches the description for a specific HTTP response code.
code (int): The specific HTTP response code.
`getAllSIPResponseCodes()`
Fetches all SIP response codes.
`getSIPResponseCodeDescription(code)`
Fetches the description for a specific SIP response code.
code (int): The specific SIP response code.
## Contributing
Contributions, issues, and feature requests are welcome! Feel free to check issues page https://github.com/ajamous/response-codes-api-client/issues