Api References
Authentication
Authenticate with the DVPay API using API keys.
DVPay API uses API key authentication. All requests must include the following headers:
X-App-Id: Your application IDX-Api-Key: Your API keyX-Timestamp: Current Unix timestamp
Example Headers
package main
import (
"fmt"
"net/http"
"time"
)
func createAuthenticatedRequest(url string) (*http.Request, error) {
req, err := http.NewRequest("POST", url, nil)
if err != nil {
return nil, err
}
req.Header.Set("X-App-Id", "your-app-id")
req.Header.Set("X-Api-Key", "your-api-key")
req.Header.Set("X-Timestamp", fmt.Sprintf("%d", time.Now().Unix()))
req.Header.Set("Content-Type", "application/json")
return req, nil
}
const axios = require('axios');
const createAuthHeaders = () => ({
'X-App-Id': 'your-app-id',
'X-Api-Key': 'your-api-key',
'X-Timestamp': Math.floor(Date.now() / 1000).toString(),
'Content-Type': 'application/json'
});
// Usage
const response = await axios.post(url, data, {
headers: createAuthHeaders()
});
Security Notes
- Keep your API keys secure and never commit them to version control
- Use environment variables to store sensitive credentials
- Rotate your API keys periodically