Overview
Following API best practices helps you build secure, reliable, and scalable integrations with the SPRL REST APIs. By adopting recommended development practices, you can improve application performance, reduce failures, and simplify long-term maintenance.
Secure Your API Credentials
- Store your Client ID and Client Key securely.
- Never expose API credentials in frontend JavaScript or mobile applications.
- Use environment variables or secure configuration storage.
- Rotate API Keys whenever you believe they may have been compromised.
Always Use HTTPS
All SPRL API requests should be sent over HTTPS to protect authentication credentials and transmitted data. Avoid making API requests over unsecured connections.
Validate Requests Before Sending
- Verify all required parameters.
- Validate user input before submitting requests.
- Ensure data types and formats are correct.
- Avoid sending incomplete or duplicate requests.
Optimise API Usage
| Recommendation | Benefit |
| Cache reusable data | Reduces unnecessary API requests. |
| Batch background operations | Improves overall application performance. |
| Avoid repeated requests | Reduces API usage and improves efficiency. |
| Monitor API usage | Helps identify performance issues early. |
Handle API Responses Properly
- Check the HTTP status code returned by every request.
- Handle both successful and failed responses.
- Use the returned response information to determine the next action.
- Display user-friendly error messages where appropriate.
Respect Rate Limits
Design your application to stay within the configured API rate limits. Avoid sending large bursts of requests and implement appropriate delays when retrying temporary failures.
Logging and Monitoring
- Log important API requests and responses.
- Record failed requests for troubleshooting.
- Monitor unusual API activity.
- Review application logs regularly to identify potential issues.
Keep Your Integration Up to Date
- Review API documentation regularly.
- Test integrations after major application updates.
- Keep your SDKs and dependencies updated.
- Review new API features as they become available.
Frequently Asked Questions
Should I store API credentials in my source code?
No. Store credentials securely using environment variables or a secure configuration system.
Why should I validate requests before sending them?
Validation reduces failed requests, improves application reliability, and provides a better user experience.
Should every API response be logged?
Logging important requests and failures is recommended for monitoring, debugging, and auditing purposes.
How often should I review my integration?
Review your integration periodically and whenever new API features or updates are introduced.
Learn More
Explore the complete Developer API documentation to learn about available endpoints, authentication, request parameters, and integration examples.
Tip
Build your integration as if it will run unattended in production. Secure credential storage, proper validation, response handling, logging, and monitoring will significantly improve long-term reliability.