Webhooks
In this guide, we will look at how to register and consume webhooks to integrate your app with Uprise. With webhooks, your app can know when something happens in Uprise, such as an advisor updating a recommendation or a finanical plan becoming available.
Getting webhooks
This endpoint returns all registered webhooks.
Required attributes
For authentication of the URL, it is required to provide one of the authentication credentials (i.e., apiKey, jwt, basic auth).
- Name
apiKey
- Type
- string
- Description
The api key for authentication.
- Name
jwt
- Type
- string
- Description
The jwt for authentication.
- Name
userName
- Type
- string
- Description
The username of basic authentication. The password field is also required with this option.
- Name
password
- Type
- string
- Description
The password of basic authentication.
Request
curl https://beta-api.uprise.us/webhooks \
-H "Content-Type: application/json" \
-d '{"jwt": "jwt token"}'
Response
[
{
"id": "403eccb2-bc6b-4e47-94c3-3da16b080d27",
"eventType": "task.deleted",
"endPointUrl": "url:/webhook",
"endPointDesc": null,
"endPointName": null
},
{
"id": "d8e0c9da-5f55-4d87-ba97-04e868833e67",
"eventType": "task.updated",
"endPointUrl": "url:/webhook",
"endPointDesc": null,
"endPointName": null
},
{
"id": "4573c7ca-c182-4144-b854-06f30d8a472c",
"eventType": "plan.created",
"endPointUrl": "url:/webhook",
"endPointDesc": null,
"endPointName": null
}
]
Registering webhooks
To register a new webhook, you need to have a URL in your app that Uprise can call. You can configure a new webhook through the registration endpoint.
Required attributes
For authentication of the URL, it is required to provide one of the authentication credentials (i.e., apiKey, jwt, basic auth).
- Name
eventType
- Type
- string
- Description
The type of the event that your app is interested in. Viable Event types are listed at the bottom of this page.
- Name
endPointUrl
- Type
- string
- Description
The url of the endpoint of your app.
- Name
apiKey
- Type
- string
- Description
The api key for authentication.
- Name
jwt
- Type
- string
- Description
The jwt for authentication.
- Name
userName
- Type
- string
- Description
The username of basic authentication. The password field is necessary for this option.
- Name
password
- Type
- string
- Description
The password of basic authentication.
Optional attributes
- Name
endPointDesc
- Type
- string
- Description
Description of the endpoint.
- Name
endPointName
- Type
- string
- Description
Name of the endpoint.
Request
curl https://beta-api.uprise.us/webhooks \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"eventType": "task.created", "endPointUrl": "url:/webhook"}'
Response
{
"id": "04e429ba-6f6c-4765-8289-a4794495f9f3"
}
Updating webhooks
This endpoint updates a webhook's properties.
Required attributes
For authentication of the URL, it is required to provide one of the authentication credentials (i.e., apiKey, jwt, basic auth).
- Name
eventType
- Type
- string
- Description
The type of the event that your app is interested in. Viable event types are at the bottom of this page.
- Name
endPointUrl
- Type
- string
- Description
The url of the endpoint of your app.
- Name
apiKey
- Type
- string
- Description
The api key for authentication.
- Name
jwt
- Type
- string
- Description
The jwt for authentication.
- Name
userName
- Type
- string
- Description
The username of basic authentication. The password field is necessary for this option.
- Name
password
- Type
- string
- Description
The password of basic authentication.
Optional attributes
- Name
endPointDesc
- Type
- string
- Description
Description of the endpoint.
- Name
endPointName
- Type
- string
- Description
Name of the endpoint.
Request
curl https://beta-api.uprise.us/webhooks \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"eventType": "task.created", "endPointUrl": "url:/webhook"}'
Response
{
"id": "04e429ba-6f6c-4765-8289-a4794495f9f3"
}
Deleting webhooks
This endpoint deletes a webhook.
Required attributes
For authentication of the URL, it is required to provide one of the authentication credentials (i.e., apiKey, jwt, basic auth).
- Name
eventType
- Type
- string
- Description
The type of the event that your app is interested in. Viable event types are listed at the bottom of this page.
Optional attributes
- Name
id
- Type
- string
- Description
Id of the webhook.
Request
curl https://beta-api.uprise.us/webhooks \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"eventType": "task.created"}}'
Response
{
"id": "04e429ba-6f6c-4765-8289-a4794495f9f3"
}
Now, whenever something of interest happens, a webhook is fired off by Uprise. In the next section, we'll look at how to consume webhooks.
Consuming webhooks
When your app receives a webhook request from Uprise, check the type
attribute to see what event caused it. The first part of the event type will tell you the payload type.
Example webhook payload
{
"id": "04e429ba-6f6c-4765-8289-a4794495f9f3",
"type": "task.updated",
"payload": {
// ...
}
}
In the example above, a task was updated
, and the payload type is a task
.
Event types
- Name
task.created
- Description
A new task was created.
- Name
task.updated
- Description
An existing task was updated.
- Name
task.deleted
- Description
A task was successfully deleted.
- Name
recommendation.created
- Description
A recommendation was created.
- Name
recommendation.updated
- Description
A recommendation was updated.
- Name
recommendation.deleted
- Description
A recommendation was deleted.
- Name
plan.created
- Description
A plan was created.
- Name
plan.updated
- Description
A plan was updated.
- Name
plan.completed
- Description
A plan was completed.
- Name
message.created
- Description
A message was created.
- Name
notification.completed
- Description
A notification was completed.
Example payload
{
"id": "c24537fb-1df9-473d-a6bb-cadb9eb5e7bd",
"type": "task.updated",
"payload": {
"id": "a00a3573-edf1-4272-a849-b0e60bb2392c",
"userId": "e4bb74a9-f871-4d0c-9b28-bb6b44ee911e",
"financialPlanId": "dbc7e796-3592-42f6-babb-9f4a6c3bcea2"
}
}