API Testing Guide
Overview
This guide provides practical examples for testing the Wisefish API endpoints using various tools and programming languages.
Quick Start Checklist
Prerequisites
-
Obtain Client ID and Client Secret from Wisefish support
-
Identify your Tenant ID and Environment
-
Choose your testing tool (Postman, curl, or programming language)
Authentication Flow
-
Get Token: Use OAuth 2.0 to obtain bearer token
-
Set Headers: Include
Authorization: Bearer {token}in all API calls -
Make Requests: Query endpoints with proper company ID
Testing with Postman
Environment Variables
Create these variables in Postman:
-
tenantId: Your Microsoft tenant ID -
environment: Your BC environment name -
clientId: 7ddde6ce-8d2b-4697-ad36-060a9e172d2c -
clientSecret: Your assigned secret
Sample Collection
Import these requests to get started:
GET {{baseUrl}}/{{tenantId}}/{{environment}}/api/v2.0/companies
GET {{baseUrl}}/{{tenantId}}/{{environment}}/api/wisefish/wiFiEP/v1.0/companies({{companyId}})/items
GET {{baseUrl}}/{{tenantId}}/{{environment}}/api/wisefish/wiFiEP/v1.0/companies({{companyId}})/lots
Common Testing Scenarios
1. Verify Connection
Start by testing the companies endpoint to ensure your authentication works.
2. Query Items
Test item filtering with different parameters:
-
?$filter=wfItemType eq 'Product' -
?$filter=lastModified gt 2024-01-01T00:00:00Z
3. Monitor Lots
Set up automated checks for lot status changes:
-
?$filter=postingStatus eq 'Open' -
?$filter=activeInProduction eq true
Troubleshooting
Common Issues
-
401 Unauthorized: Check token expiration (1 hour limit)
-
404 Not Found: Verify company ID and endpoint URLs
-
400 Bad Request: Check OData filter syntax
Rate Limiting
Be mindful of API call frequency. Consider implementing:
-
Token caching (reuse for up to 1 hour)
-
Batch requests where possible
-
Exponential backoff for retries
Next Steps
-
Review specific endpoint documentation
-
Implement error handling in your integration
-
Set up monitoring for production systems
Last updated: November 2024