fix(onesignal_rest_api): migrate to V2 org token auth and new API base URL#20995
Conversation
…e URL - Update base URL from https://onesignal.com/api/v1 to https://api.onesignal.com - Change Authorization header from `Basic` to `Key` prefix (V2 org token) - Move app_id from request body to query params Closes PipedreamHQ#20982
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
Thank you so much for submitting this! We've added it to our backlog to review, and our team has been notified. |
|
Thanks for submitting this PR! When we review PRs, we follow the Pipedream component guidelines. If you're not familiar, here's a quick checklist:
|
📝 WalkthroughWalkthroughThe OneSignal REST API integration now targets ChangesOneSignal REST API Migration
Sequence DiagramsequenceDiagram
participant Client
participant OneSignalRESTSDK
participant OneSignalAPI as api.onesignal.com
Client->>OneSignalRESTSDK: invoke action (e.g. createNotification)
OneSignalRESTSDK->>OneSignalAPI: HTTP request (Authorization: Key <rest_api_key>, params: app_id, body: options.data)
OneSignalAPI-->>OneSignalRESTSDK: HTTP response
OneSignalRESTSDK-->>Client: return response
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
michelle0927
left a comment
There was a problem hiding this comment.
@sergio-eliot-rodriguez This is failing checks. You need to update the package.json version and the component versions.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@components/onesignal_rest_api/actions/get-devices/get-devices.mjs`:
- Line 8: The action version in get-devices.mjs (and the other three actions
add-device, create-notification, get-device) must be changed from the MINOR bump
to a PATCH to match the package bump; update the version field in each action
file to the same PATCH version as the package (make the actions' version value
equal to the package's 0.0.4 PATCH) so component-level semver aligns with the
package instead of using 0.1.0; ensure you modify the top-level "version" string
in each action (e.g., in get-devices.mjs) accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: e0890435-fe0b-4e14-a70c-382b011ef7c8
📒 Files selected for processing (4)
components/onesignal_rest_api/actions/add-device/add-device.mjscomponents/onesignal_rest_api/actions/create-notification/create-notification.mjscomponents/onesignal_rest_api/actions/get-device/get-device.mjscomponents/onesignal_rest_api/actions/get-devices/get-devices.mjs
michelle0927
left a comment
There was a problem hiding this comment.
LGTM, Ready for QA
Summary
Fixes #20982 — OneSignal is deprecating V1 User Tokens on 2026-06-15.
https://onesignal.com/api/v1→https://api.onesignal.comBasic <token>→Key <token>(V2 Organization Token)app_idplacement: moved from request body (data) to query params (params)All four action components (
add-device,create-notification,get-device,get-devices) delegate to the centralized_makeRequestmethod in the app file, so they require no changes.Test plan
get-devices— verify it returns the player list without auth errorsget-device— verify a specific device is returnedcreate-notification— verify a notification is created successfullyadd-device— verify a new device is registered🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Chores