Notifications
You can send Notifications using Jigx Management or programmatically in your solutions, see Notifications. Notifications can be configured to be sent to a single user, the entire organization, users of a specific solution, and even users of a specific jig in a specific solution.
Configuration options
function
Define a function in the Functions folder of your solution. The function has input parameters such as the notification title, the notification text and requires a Jigx accessToken or personal access token (PAT) .
jig
jigs will invoke the function for sending notifications either via submitting form values to the function or by using an execute-entity action for invoking the function.
Notification URL per region
Examples and code snippets
Notification sent when submitting a form
In this example we are using hidden form components (e.g. organizationId) to pass required parameters to the function. The emails field contains a comma-separated list of recipients. You could also use Expressions to create that comma-separated string dynamically at runtime.
Once you submitted the form, the recipients should receive both a push notification and an in-app notification. You can also check the delivery status of your notification in the Notifications section of the Jigx Management.
Add a function definition called send-notification.jigx to the functions folder of your solution and copy & paste the following snippet into it. Replace the {organizationId} in the url with your organization's Id.

See the code sample in GitHub.
# Add this file under the functions folder
provider: DATA_PROVIDER_REST
method: POST
url: https://us-east-1.api.jigx.com/v2.0/tool/organizations/{organizationId}/notifications
inputTransform: >-
$.{
"content": {
"title":title,
"text":text,
"jigId":jigId,
"screen":"jig"
},
"scope":scope,
"emails":emails,
"description": "description",
"solutionId": solutionId
}
parameters:
solutionId:
type: string
location: body
required: false
jigId:
type: string
location: body
required: false
value: notification-form
deviceId:
location: body
type: string
required: true
value: jig
command:
location: body
type: string
required: false
value: createNotification
organizationId:
location: path
type: string
required: true
scope:
location: body
type: string
required: false
value: USR
emails:
location: body
type: array
required: true
title:
location: body
type: string
required: true
text:
location: body
type: string
required: true
accessToken:
location: header
type: jigx
value: jigx
required: true
title: Send Notification (submit-form)
icon: alert-circle
type: jig.default
actions:
- children:
- type: action.submit-form
options:
title: Send notification
formId: send-form
provider: DATA_PROVIDER_REST
method: functionCall
function: send-notification
entity: send-notification
onSuccess:
title: Message sent
children:
- type: component.form
instanceId: send-form
options:
children:
- type: component.text-field
instanceId: title
options:
label: Title
- type: component.text-field
instanceId: text
options:
label: Text
- type: component.text-field
instanceId: organizationId
options:
label: organizationId
initialValue: [email protected]
isHidden: true
- type: component.text-field
instanceId: solutionId
options:
label: solutionId
initialValue: [email protected]
isHidden: true
- type: component.text-field
instanceId: emails
options:
label: emails
initialValue: [email protected]
isHidden: true
- type: component.text-field
instanceId: accessToken
options:
label: accessToken
initialValue: jigx
isHidden: trueSend notification with execute-entity
You can also send notifications using an execute-entity action if you want to have more control over what's being sent to the function.
In this example we are using state to access the two form fields title and text. All other function's parameters are set in the execute-entity action. Note that you don't have to use form fields as you could also assign all parameters in the action itself.

# Add this file under the functions folder
provider: DATA_PROVIDER_REST
method: POST
url: https://us-east-1.api.jigx.com/v2.0/tool/organizations/{organizationId}/notifications
inputTransform: >-
$.{
"content": {
"title":title,
"text":text,
"jigId":jigId,
"screen":"jig"
},
"scope":scope,
"emails":emails,
"description": "description",
"solutionId": solutionId
}
parameters:
solutionId:
type: string
location: body
required: false
jigId:
type: string
location: body
required: false
value: notification-form
deviceId:
location: body
type: string
required: true
value: jig
command:
location: body
type: string
required: false
value: createNotification
organizationId:
location: path
type: string
required: true
scope:
location: body
type: string
required: false
value: USR
emails:
location: body
type: array
required: true
title:
location: body
type: string
required: true
text:
location: body
type: string
required: true
accessToken:
location: header
type: jigx
value: jigx
required: true
title: Send Notification (execute-entity)
icon: alert-circle
type: jig.default
actions:
- children:
- type: action.execute-entity
options:
title: Send now
provider: DATA_PROVIDER_REST
method: functionCall
entity: send-notification
function: send-notification
parameters:
deviceId: jig
organizationId: [email protected]
solutionId: [email protected]
emails: [email protected]
title: [email protected]
text: [email protected]
accessToken: jigx
onSuccess:
title: Message sent
children:
- type: component.form
instanceId: send-form
options:
children:
- type: component.text-field
instanceId: title
options:
label: Title
- type: component.text-field
instanceId: text
options:
label: TextSend notification with a target jig with input parameters
You can also target a specific jig with input parameters from your push notification. An example of this would be a notification about a new product promotion with the promotion detail jig as the target. When the user taps on the notification (either on the native push notification or the in-app notification), the app will navigate to the specific promotion


For this, you need an adjusted REST function definition (see 1), a Jig that invokes the REST function (see 2), and a target jig that will be displayed when the user taps on the notification (see 3).
Replace the {organizationId} in the url with your organization's Id.
See the code sample in GitHub.
# Add this file under the functions folder
provider: DATA_PROVIDER_REST
method: POST
url: https://us-east-1.api.jigx.com/v2.0/tool/organizations/{organizationId}/notifications
inputTransform: >
$.{
"content": {
"title": title,
"text": text,
"screen": "jig",
"jigId": jigId,
"inputs":{
"promotionId":promotionId
}
},
"scope": scope,
"emails": emails,
"solutionId": solutionId
}
parameters:
deviceId:
location: body
type: string
required: true
value: jig
command:
location: body
type: string
required: false
value: createNotification
organizationId:
location: path
type: string
required: true
scope:
location: body
type: string
required: false
value: USR
emails:
location: body
type: array
required: true
title:
location: body
type: string
required: true
text:
location: body
type: string
required: true
promotionId:
location: body
type: string
required: true
solutionId:
location: body
type: string
required: true
jigId:
location: body
type: string
required: true
accessToken:
location: header
type: jigx
value: jigx
required: true
title: Send Notification (target jig)
icon: alert-circle
type: jig.default
actions:
- children:
- type: action.execute-entity
options:
title: Send now
provider: DATA_PROVIDER_REST
method: functionCall
entity: send-notification-target-jig
function: send-notification-target-jig
parameters:
deviceId: jig
organizationId: [email protected]
emails: [email protected]
title: 🎉 New product promotion
text: Check it out now
solutionId: [email protected]
promotionId: promo12345
jigId: view-promotion-details
accessToken: jigx
onSuccess:
title: Message sent
children:
- type: component.form
instanceId: send-form
options:
children:
- type: component.text-field
instanceId: title
options:
label: Title
- type: component.text-field
instanceId: text
options:
label: Texttitle: Promotion Details
icon: zoom-in
type: jig.default
datasources:
promotions:
type: datasource.static
options:
data:
- promotionId: promo12345
name: Stylish Teapot Promo
price: 25
image: https://picsum.photos/id/225/500/300
children:
- type: component.image
options:
source:
uri: [email protected][promotionId = @ctx.jig.inputs.promotionId].image
resizeMode: cover
height: 300
- type: component.entity
options:
children:
- type: component.field-row
options:
children:
- type: component.entity-field
options:
label: Promotion
value: [email protected][promotionId = @ctx.jig.inputs.promotionId].name
- type: component.entity-field
options:
label: Promotion #
value: [email protected]
- type: component.entity-field
options:
label: Price
value:
text: [email protected][promotionId = @ctx.jig.inputs.promotionId].price
format:
numberStyle: currency
currency: USD Sending push notifications using the Jigx notification Endpoint
See External push notifications (API) for more information and examples.
Last updated
Was this helpful?