Overview
This node enables interaction with any OData-compliant REST API by allowing users to perform standard HTTP operations (GET, POST, PATCH, DELETE) on OData resources. It is useful for integrating with services exposing OData endpoints, such as Microsoft Graph or other enterprise APIs that follow the OData protocol.
Common scenarios include:
- Querying data from an OData service with filtering, selecting specific fields, ordering, and pagination.
- Creating new records or updating existing ones via POST or PATCH requests.
- Deleting resources using DELETE requests.
- Using advanced OData query options to customize requests precisely.
For example, you could use this node to fetch a list of users filtered by last name, create a new user record, or update user details in an OData-based directory service.
Properties
| Name | Meaning |
|---|---|
| URL | The base URL of the OData service endpoint (e.g., https://graph.microsoft.com/v1.0/). |
| Authentication | Choose the authentication method: None or a generic credential type supporting various auth schemes. |
| Credential Type | Select the predefined credential type to authenticate requests when using predefined authentication. |
| Generic Auth Type | Select the generic authentication credential type when using customizable authentication methods. |
| Method | HTTP method to use: GET, POST, PATCH, or DELETE. |
| Resource | The specific OData resource path to target (e.g., People('scottketchum')). |
| Data | JSON string representing the data payload for POST or PATCH requests. |
| Advanced | Toggle to show advanced query options. |
| Raw Query | Raw OData query expressed as a JSON string; overrides individual query parameters if provided. |
| $select | Comma-separated list of fields to select in the response. |
| $filter | OData filter expression to restrict results. |
| $orderby | Field(s) to order the results by. |
| $top | Number of results to return (limit). |
| $skip | Number of results to skip (offset). |
Output
The node outputs an array of items where each item contains a json property holding the parsed JSON response from the OData service for each request made. Each output item corresponds to one input item processed.
If multiple records are returned, they are output as separate items. The node does not output binary data.
Example output structure for one item:
{
"json": {
// Parsed JSON object returned by the OData API
}
}
Dependencies
- Requires access to an OData-compliant REST API endpoint.
- Supports optional authentication via:
- No authentication
- Generic credential types (basic, header, OAuth2, etc.)
- Predefined credential types (OAuth1, OAuth2, or others with authenticate method)
- Uses the
odatanpm package internally to build and execute OData queries. - If OAuth2 authentication is used, appropriate credentials must be configured in n8n.
Troubleshooting
- Invalid JSON in Data or Query fields: The node expects valid JSON strings for the
DataandRaw Queryproperties. Malformed JSON will cause parsing errors. Ensure these inputs are correctly formatted. - Authentication failures: If using authentication, ensure credentials are correctly set up and valid. Expired tokens or incorrect credentials will result in authorization errors.
- Incorrect resource paths: The
Resourceproperty must be a valid OData resource path. Incorrect paths may lead to 404 or other HTTP errors. - Unsupported HTTP methods: Only GET, POST, PATCH, and DELETE are supported. Using other methods will cause errors.
- API rate limits or throttling: When querying large datasets or making many requests, watch for API limits imposed by the OData service.
- Error handling: If the node is set to continue on fail, errors for individual items will be included in the output with error details; otherwise, execution stops on the first error.
Links and References
- OData Official Site
- Microsoft Graph API (example OData service)
- OData npm package (used internally by the node)