Last updated: 3:11 PM - December 8, 2024
This object represents a push notification campaign. Use it to create notification campaigns and define the content, frequency, and delivery details of push notifications sent to users.
- POST /v1/notifications/campaigns
- PATCH /v1/notifications/campaigns/:id
- GET /v1/notifications/campaigns/:id
- GET /v1/notifications/campaigns
- DELETE /v1/notifications/campaigns/:id
Unique identifier for the push notification campaign (MongoDB ObjectID).
The ID of the user who created the campaign.
The name of the notification campaign.
The content/message of the notification to be sent to users.
The frequency of the campaign (e.g., 'daily', 'weekly').
How the notification is delivered (e.g., 'instant', 'scheduled').
Timestamp indicating when the notification should be delivered (Unix timestamp).
The current status of the campaign (e.g., 'active', 'paused').
Additional metadata associated with the campaign. Can contain key-value pairs for storing extra information.
Timestamp when the campaign was created (Unix timestamp).
Timestamp of the last update to the campaign (Unix timestamp).
Version number of the campaign, typically used for concurrency control.
{ "id": "66c39410f772e80b520398fb", "userID": "662eacdd93c3237c5873dc20", "name": "Summer Sale Campaign", "content": "Don't miss our summer sale! Get up to 50% off!", "frequency": "daily", "deliverType": "scheduled", "deliverAt": 1729006624, "status": "active", "metadata": { }, "created": 1729006624, "updated_at": 1729006624, "v": 1, }
The ID of the user creating the notification campaign.
API key for authenticating the request.
The name of the campaign (e.g., 'Summer Sale Campaign').
The main content or message of the campaign.
The frequency of the campaign. For a one-time campaign, set this to 'once'.
The type of delivery, e.g., 'scheduled' or 'instant'.
Unix timestamp when the campaign is scheduled to be delivered.
The current status of the campaign (e.g., 'draft', 'active').
Additional metadata for the campaign, such as 'audience' and 'priority'.
An object containing the details of the created notification campaign.
A message indicating the success of the campaign creation.
The status of the API request, typically 'success' if the request was successful.
curl -L 'https://api.gowithpush.com/v1/notifications/create' \ -H 'userID: 662eacdd93c3237c5873dc20' \ -H 'Content-Type: application/json' \ -H 'X-API-Key: <YOUR-API-KEY>' \ -d '{ "name": "Summer Sale Campaign", "content": "Don\'t miss our summer sale!", "frequency": "once", "deliver_type": "scheduled", "deliver_at": 1634567890, "status": "draft", "metadata": { "audience": "all_users", "priority": "high" } }'
{ "campaign": { "id": "67205ce1c403f48c50a02a33", "userID": "662eacdd93c3237c5873dc20", "name": "Summer Sale Campaign", "content": "Don't miss our summer sale!", "frequency": "once", "deliver_type": "scheduled", "deliver_at": 1634567890, "status": "draft", "metadata": { "audience": "all_users", "priority": "high" }, "created": 1730174177, "updated_at": 1730174177, "v": 1 }, "message": "Campaign created successfully", "status": "success" }
The unique identifier of the campaign to retrieve.
The ID of the user requesting the campaign details.
API key for authenticating the request.
An object containing the details of the notification campaign.
The status of the API request, typically 'success' if the request was successful.
curl -L 'https://api.gowithpush.com/v1/notifications/66c3d2cf14b4a6acb17c4664' \ -H 'userID: 662eacdd93c3237c5873dc20' \ -H 'X-API-Key: <YOUR-API-KEY>'
{ "campaign": { "id": "66c3d2cf14b4a6acb17c4664", "userID": "662eacdd93c3237c5873dc20", "name": "First Notification", "content": "Come connect with us this Saturday!", "frequency": "once", "deliver_type": "", "deliver_at": 1724118870, "status": "draft:staged", "metadata": {}, "created": 1724109519, "updated_at": 1724118870, "v": 1 }, "status": "success" }
The page number of the paginated results.
The number of results to return per page.
The ID of the user requesting the campaigns.
API key for authenticating the request.
An array of notification campaign objects.
Information about the pagination of the results.
The status of the API request, typically 'success' if the request was successful.
curl -L 'https://api.gowithpush.com/v1/notifications?page=1&per_page=25' \ -H 'userID: 662eacdd93c3237c5873dc20' \ -H 'X-API-Key: <YOUR-API-KEY>'
{ "campaigns": [ { "id": "66db3482a12df8592575c0e2", "userID": "662eacdd93c3237c5873dc20", "name": "Winter Sale", "content": "Enjoy up to 30% off this winter season!", "frequency": "weekly", "deliver_type": "all", "deliver_at": 1725641858, "status": "active", "metadata": {}, "created": 1725641858, "updated_at": 1725641858, "v": 1 } ], "pagination": { "current_page": 1, "has_next": true, "has_prev": false, "per_page": 25, "total_items": 32, "total_pages": 2 }, "status": "success" }
The unique ID of the notification to be updated.
API Key for authenticating the request.
The content/message of the notification.
The name of the notification.
How often the notification should be sent.
Unix timestamp for when the notification should be delivered.
The status of the notification.
curl -L -X PATCH 'https://api.gowithpush.com/2024-10/notifications/update?id=677e8b3feab351dd76837f5f' -H 'Content-Type: application/json' -H 'X-API-Key: <YOUR-API-KEY>' --data-raw '{ "name": "", "content": "get your latest plan off rn!", "frequency": "", "deliver_at": 0, "status": "" }'
{ "notification": { "id": "677e8b3feab351dd76837f5f", "name": "", "content": "get your latest plan off rn!", "frequency": "", "deliver_at": 0, "status": "", "updated_at": 1729717316 }, "status": "success" }
The unique ID of the notification to be deleted.
API Key for authenticating the request.
curl -L -X DELETE 'https://api.gowithpush.com/2024-10/notifications/delete?id=677e8b3feab351dd76837f5f' -H 'X-API-Key: <YOUR-API-KEY>'
{ "id": "677e8b3feab351dd76837f5f", "isDeleted": true, "message": "Notification deleted successfully", "status": "success" }