Migration Guide (API V1 to API V2)
0 people liked this article
Introduction to API V2
Welcome to API V2, our REST-based API designed for scalability, consistency, and long-term evolution. API V2 replaces the legacy GraphQL-based V1 and is the future-ready platform for all integrations.
Key principles:
- RESTful, resource-oriented design
- Predictable request/response structure
- Built-in pagination, filtering, and sorting
- Designed for performance and maintainability
⚠️ All new features and enhancements will be released exclusively on V2.
Why Migrate to API V2?
API V2 is the strategic platform moving forward.
Key Reasons
- All new features will be added to V2 only
- Improved performance and scalability
- Simpler integration using REST conventions
- Better support for pagination, filtering, and sorting
⚠️ API V1 will sunset and will no longer be available after the deadline.
Feature Parity
API V2 has full feature parity with V1.
However:
-
Some features may be
- structured differently; flattened instead of nested
-
Some fields may be:
- Removed
- Renamed
- Moved to different endpoints
-
Some data may be:
- Flattened
- Returned via different endpoints
- Retrieved via multiple calls
Migration Approach
Step 1: Inventory Current Usage
- Identify all GraphQL queries
-
Group by resource:
- Accounts
- Sites
- Services
- Cases
Step 2: Map to REST Endpoints
Example:
| V1 (GraphQL) | V2 (REST) |
|---|---|
account.sites |
/v2/sites or /v2/accounts/{id}/sites |
account.services |
/v2/services or /v2/accounts/{id}/services |
What This Means in Practice
- In V1 (GraphQL)
You request exactly what you need:
query { viewer { account { sites { siteId name city } } }}
- In V2 (REST)
You call a dedicated endpoint:
GET /v2/sites
-
Then refine using:
- Query parameters
- Filtering
- Pagination
Step 3: Implement V2 Calls
- Replace queries with REST endpoints
- Add pagination handling
- Add filtering where needed
Step 4: Validate Data Consistency
- Compare V1 vs V2 responses
-
Validate:
- Field values
- Record counts
- Edge cases
Step 5: Rollout Gradually
- Start with non-critical workflows
- Expand coverage
- Monitor errors and performance
For detailed gap analysis, see
Important Migration Consideration
| Aspect | V1 (GraphQL) | V2 (REST) |
|---|---|---|
Data Fetching |
Single flexible query |
Multiple resource-based endpoints |
Structure |
Nested |
Resource-oriented |
Over-fetching |
Avoidable |
Controlled via filtering |
Pagination |
Custom |
Standardized (offset, limit) |
Filtering |
Query-based |
URL query parameters |
Discoverability |
Schema-based |
Endpoint-based |
Structural Differences
- GraphQL: nested responses
- REST: flattened resource objects
Multiple Calls Instead of One
- GraphQL → single query
- REST → multiple endpoint calls
Explicit Data Retrieval
- REST requires explicit endpoint selection
- Use filters to optimize responses
Pagination Is Mandatory
- Large datasets are always paginated
Validation & Testing Guidance
Compare Responses
- Ensure parity between V1 and V2 data
-
Pay attention to:
- Field naming differences
- Structure changes
- Deprecated fields
Test Pagination
- Validate full dataset retrieval
- Ensure no missing records
Test Filtering & Sorting
- Confirm results match expectations
Test Error Handling
-
Validate behavior for:
- Invalid IDs
- Unauthorized access
- Missing parameters
Best Practices
Use Pagination for Large Datasets
- Default limit: 25
- Maximum limit: 200
- Use: ?page[offset]=0&page[limit]=25
Use Filtering to Reduce Payload Size
- Example: /v2/accounts?filter[Name]=ACME Corporation
Use Sorting for Predictable Results
- Example: /v2/accounts?sort=AccountId,-Name
Handle Pagination via Links
- Use the links.next field instead of manually constructing URLs.
Implement Robust Error Handling
Expect standard HTTP status codes:
- 200: Success
- 401: Unauthorized
- 403: Forbidden
- 404: Not Found
- 422: Validation Failure
Prepare for Future Evolution
- Avoid hardcoding assumptions about response structure
- Always use documented fields
- Plan for new fields to be added
Helpful Links
Popular Articles
-
What is the Support process for managing and handling cases?
2 people say this guide was helpful
-
How to create a new case in expereoOne?
16 people say this guide was helpful
-
Where can I find the Reason for Outage (RFO) for an Incident Cases?
0 people say this guide was helpful
-
How can I contact Expereo Support?
9 people say this guide was helpful