Skip to main content

Development Setup

Prerequisites:
  • A code editor (VS Code recommended)
  • Postman for API testing
  • Agd Ejar API credentials

1. Environment Setup

First, set up your development environment variables:

2. Authentication Helper

Create a helper function to manage authentication:

Testing Tools

Postman Setup

  1. Import our Postman Collection
  2. Create an environment with these variables:
    • base_url: https://app.agdejar.sa
    • client_id: Your client ID
    • client_secret: Your client secret
    • access_token: Will be automatically set after authentication

Error Handling

Implement proper error handling in your development environment:

Best Practices

  1. Rate Limiting
    • Implement exponential backoff
    • Cache responses where appropriate
    • Monitor API usage
  2. Security
    • Never commit credentials to version control
    • Use environment variables
    • Implement proper token management
  3. Debugging
    • Enable debug logs in development
    • Use proper error handling
    • Monitor API responses

Troubleshooting

  • Verify your credentials are correct
  • Check token expiration
  • Ensure proper Content-Type headers
  • Implement request throttling
  • Add proper error handling
  • Contact support for limit adjustments

Need Help?

If you encounter any issues during development: