Generic Messenger API
On this page
1.26.0
The following APIs are provided to manage Generic Messengers.
Create the Generic Messenger#
Request#
Create a Generic Messenger with either a randomly generated Id or one you provide on the URI.
OpenAPI Spec
OpenAPI Spec
The type in the request JSON is used to determine that you are creating the Generic Messenger.
Path Parameters#
messengerIdThe Id to use for the new Messenger. If not specified a secure random UUID will be generated.
Request Body#
messenger.connectTimeout The connect timeout for the HTTP connection, in milliseconds. Value must be greater than 0.
messenger.data An object that can hold any information about the Messenger that should be persisted.
messenger.debug If debug is enabled, an event log is created to assist in debugging messenger errors.
messenger.headers An object that can hold HTTPHeader key and value pairs.
messenger.httpAuthenticationPassword The basic authentication password to use for requests to the Messenger.
messenger.httpAuthenticationUsername The basic authentication username to use for requests to the Messenger.
messenger.messageTypes The set of message types this messenger can send.
Supported values include:
SMSVoice
messenger.name The unique Messenger name.
messenger.readTimeout The read timeout for the HTTP connection, in milliseconds. Value must be greater than 0.
messenger.sslCertificateId The Id of an existing Key. The X.509 certificate is used for client certificate authentication in requests.
messenger.type This field must be set to Generic.
messenger.url The fully qualified URL of the endpoint that will accept requests from FusionAuth.
{
"messenger": {
"connectTimeout": 1000,
"data": {
"foo": "bar"
},
"debug": false,
"headers": {
"Content-Type": "application/json"
},
"httpAuthenticationPassword": "password",
"httpAuthenticationUsername": "user-login",
"messageTypes": [
"SMS",
"Voice"
],
"name": "Generic Messenger",
"readTimeout": 1000,
"sslCertificate": "e31e242b-4eca-4309-921f-48cb72ec9bfb",
"type": "Generic",
"url": "https://www.example.com/webhook"
}
}Response#
| Code | Description |
|---|---|
| 200 | The request succeeded. The response contains a JSON body. |
| 400 | The request was invalid or malformed. The response contains an Errors JSON object with the specific errors. FusionAuth also returns a 400 when the request needs a paid FusionAuth license and no license is present. |
| 401 | FusionAuth didn't authorize the request. The Authorization header is missing, the API key isn't valid, or the API key doesn't have permission for this endpoint and method. The response is empty. For more information, see Unauthorized Responses. |
| 500 | FusionAuth had an internal error and logged a stack trace in the FusionAuth log files. The response usually contains an Errors JSON object with the [Exception] general error code. On MySQL, a data field larger than the database column also returns 500. For more information, see Data Field Sizes. |
Response Body#
messenger.connectTimeout The connect timeout for the HTTP connection, in milliseconds.
messenger.data An object that can hold any information about the Messenger that should be persisted.
messenger.debug If debug is enabled, an event log is created to assist in debugging messenger errors.
messenger.headers An object that can hold HTTPHeader key and value pairs.
messenger.httpAuthenticationPassword The basic authentication password to use for requests to the Messenger.
messenger.httpAuthenticationUsername The basic authentication username to use for requests to the Messenger.
messenger.id The unique Id of the Messenger.
messenger.insertInstant The instant when the Messenger was created.
messenger.lastUpdateInstant The instant when the Messenger was last updated.
messenger.messageTypes The set of message types this messenger can send.
messenger.name The unique Messenger name.
messenger.readTimeout The read timeout for the HTTP connection, in milliseconds.
messenger.sslCertificateId The Id of an existing Key. The X.509 certificate is used for client certificate authentication in requests to the Messenger.
messenger.transport Deprecated. This legacy field remains for backward compatibility. Use messenger.messageTypes instead.
messenger.type This field will always be Generic.
messenger.url The fully qualified URL of the endpoint that will accept requests from FusionAuth.
{
"messenger": {
"connectTimeout": 1000,
"data": {
"foo": "bar"
},
"debug": false,
"headers": {
"Content-Type": "application/json"
},
"httpAuthenticationPassword": "password",
"httpAuthenticationUsername": "user-login",
"id": "2d5acca6-23d5-423f-ac7b-b70f50b54498",
"insertInstant": 1562189072183,
"lastUpdateInstant": 1562189072183,
"messageTypes": [
"SMS",
"Voice"
],
"name": "Generic Messenger",
"readTimeout": 1000,
"sslCertificate": "e31e242b-4eca-4309-921f-48cb72ec9bfb",
"transport": "sms",
"type": "Generic",
"url": "https://www.example.com/webhook"
}
}Retrieve the Generic Messenger#
Request#
Retrieve the Generic Messenger by its Id.
OpenAPI Spec
Path Parameters#
messengerIdThe Id of the Messenger to retrieve.
Response#
| Code | Description |
|---|---|
| 200 | The request succeeded. The response contains a JSON body. |
| 400 | The request was invalid or malformed. The response contains an Errors JSON object with the specific errors. FusionAuth also returns a 400 when the request needs a paid FusionAuth license and no license is present. |
| 401 | FusionAuth didn't authorize the request. The Authorization header is missing, the API key isn't valid, or the API key doesn't have permission for this endpoint and method. The response is empty. For more information, see Unauthorized Responses. |
| 404 | The object you requested doesn't exist. The response is empty. |
| 500 | FusionAuth had an internal error and logged a stack trace in the FusionAuth log files. The response is empty. |
Response Body#
messenger.connectTimeout The connect timeout for the HTTP connection, in milliseconds.
messenger.data An object that can hold any information about the Messenger that should be persisted.
messenger.debug If debug is enabled, an event log is created to assist in debugging messenger errors.
messenger.headers An object that can hold HTTPHeader key and value pairs.
messenger.httpAuthenticationPassword The basic authentication password to use for requests to the Messenger.
messenger.httpAuthenticationUsername The basic authentication username to use for requests to the Messenger.
messenger.id The unique Id of the Messenger.
messenger.insertInstant The instant when the Messenger was created.
messenger.lastUpdateInstant The instant when the Messenger was last updated.
messenger.messageTypes The set of message types this messenger can send.
messenger.name The unique Messenger name.
messenger.readTimeout The read timeout for the HTTP connection, in milliseconds.
messenger.sslCertificateId The Id of an existing Key. The X.509 certificate is used for client certificate authentication in requests to the Messenger.
messenger.transport Deprecated. This legacy field remains for backward compatibility. Use messenger.messageTypes instead.
messenger.type This field will always be Generic.
messenger.url The fully qualified URL of the endpoint that will accept requests from FusionAuth.
{
"messenger": {
"connectTimeout": 1000,
"data": {
"foo": "bar"
},
"debug": false,
"headers": {
"Content-Type": "application/json"
},
"httpAuthenticationPassword": "password",
"httpAuthenticationUsername": "user-login",
"id": "2d5acca6-23d5-423f-ac7b-b70f50b54498",
"insertInstant": 1562189072183,
"lastUpdateInstant": 1562189072183,
"messageTypes": [
"SMS",
"Voice"
],
"name": "Generic Messenger",
"readTimeout": 1000,
"sslCertificate": "e31e242b-4eca-4309-921f-48cb72ec9bfb",
"transport": "sms",
"type": "Generic",
"url": "https://www.example.com/webhook"
}
}Update the Generic Messenger#
This API is used to update an existing Generic Messenger.
You must specify all of the properties of the Generic Messenger when calling this API with the PUT HTTP method. When used with PUT, this API doesn't merge the existing Generic Messenger and your new data. It replaces the existing Generic Messenger with your new data.
Utilize the PATCH HTTP method to send specific changes to merge into an existing Generic Messenger.
Request#
Send the full Generic Messenger with your changes applied.
OpenAPI Spec
OpenAPI Spec
For backward compatibility, a PATCH request with a Content-Type of application/json accepts the same body as the PUT request. FusionAuth merges the request into the existing object:
- FusionAuth keeps every field that the request leaves out, so send only the fields you want to change.
- FusionAuth merges a map, such as
data, by key. To remove a key, set the key tonull. - FusionAuth appends the values in a request array to the existing array, unless this API documents otherwise. An empty array leaves the existing array unchanged, so you can't remove values from an appending array.
- FusionAuth adds each object in an array of objects as a new element. FusionAuth doesn't match the object to an existing element by Id or by position.
- Don't send a value that an array of Ids already contains, such as a key Id or a Tenant Id. Some of these arrays then return a
500status code. - Don't set an array to
null. Depending on the field, FusionAuth clears the array or returns a500status code.
To remove values from an array, PUT the full object, or set the Content-Type to one of the following media types:
application/json-patch+jsonfor JSON Patch (RFC 6902)application/merge-patch+jsonfor JSON Merge Patch (RFC 7396)
For more information, see The PATCH HTTP Method.
On this API,PATCH replaces messenger.messageTypes instead of appending to the array. An empty array returns a 400 status code.Path Parameters#
messengerIdThe Id of the Messenger to update.
Request Body#
messenger.connectTimeout The connect timeout for the HTTP connection, in milliseconds. Value must be greater than 0.
messenger.data An object that can hold any information about the Messenger that should be persisted.
messenger.debug If debug is enabled, an event log is created to assist in debugging messenger errors.
messenger.headers An object that can hold HTTPHeader key and value pairs.
messenger.httpAuthenticationPassword The basic authentication password to use for requests to the Messenger.
messenger.httpAuthenticationUsername The basic authentication username to use for requests to the Messenger.
messenger.messageTypes The set of message types this messenger can send.
Supported values include:
SMSVoice
messenger.name The unique Messenger name.
messenger.readTimeout The read timeout for the HTTP connection, in milliseconds. Value must be greater than 0.
messenger.sslCertificateId The Id of an existing Key. The X.509 certificate is used for client certificate authentication in requests.
messenger.type This field must be set to Generic.
messenger.url The fully qualified URL of the endpoint that will accept requests from FusionAuth.
{
"messenger": {
"connectTimeout": 1000,
"data": {
"foo": "bar"
},
"debug": false,
"headers": {
"Content-Type": "application/json"
},
"httpAuthenticationPassword": "password",
"httpAuthenticationUsername": "user-login",
"messageTypes": [
"SMS",
"Voice"
],
"name": "Generic Messenger",
"readTimeout": 1000,
"sslCertificate": "e31e242b-4eca-4309-921f-48cb72ec9bfb",
"type": "Generic",
"url": "https://www.example.com/webhook"
}
}Response#
The response for this API contains the Generic Messenger.
| Code | Description |
|---|---|
| 200 | The request succeeded. The response contains a JSON body. |
| 400 | The request was invalid or malformed. The response contains an Errors JSON object with the specific errors. FusionAuth also returns a 400 when the request needs a paid FusionAuth license and no license is present. |
| 401 | FusionAuth didn't authorize the request. The Authorization header is missing, the API key isn't valid, or the API key doesn't have permission for this endpoint and method. The response is empty. For more information, see Unauthorized Responses. |
| 404 | The object you're updating doesn't exist. The response is empty. |
| 500 | FusionAuth had an internal error and logged a stack trace in the FusionAuth log files. The response usually contains an Errors JSON object with the [Exception] general error code. On MySQL, a data field larger than the database column also returns 500. For more information, see Data Field Sizes. |
Response Body#
messenger.connectTimeout The connect timeout for the HTTP connection, in milliseconds.
messenger.data An object that can hold any information about the Messenger that should be persisted.
messenger.debug If debug is enabled, an event log is created to assist in debugging messenger errors.
messenger.headers An object that can hold HTTPHeader key and value pairs.
messenger.httpAuthenticationPassword The basic authentication password to use for requests to the Messenger.
messenger.httpAuthenticationUsername The basic authentication username to use for requests to the Messenger.
messenger.id The unique Id of the Messenger.
messenger.insertInstant The instant when the Messenger was created.
messenger.lastUpdateInstant The instant when the Messenger was last updated.
messenger.messageTypes The set of message types this messenger can send.
messenger.name The unique Messenger name.
messenger.readTimeout The read timeout for the HTTP connection, in milliseconds.
messenger.sslCertificateId The Id of an existing Key. The X.509 certificate is used for client certificate authentication in requests to the Messenger.
messenger.transport Deprecated. This legacy field remains for backward compatibility. Use messenger.messageTypes instead.
messenger.type This field will always be Generic.
messenger.url The fully qualified URL of the endpoint that will accept requests from FusionAuth.
{
"messenger": {
"connectTimeout": 1000,
"data": {
"foo": "bar"
},
"debug": false,
"headers": {
"Content-Type": "application/json"
},
"httpAuthenticationPassword": "password",
"httpAuthenticationUsername": "user-login",
"id": "2d5acca6-23d5-423f-ac7b-b70f50b54498",
"insertInstant": 1562189072183,
"lastUpdateInstant": 1562189072183,
"messageTypes": [
"SMS",
"Voice"
],
"name": "Generic Messenger",
"readTimeout": 1000,
"sslCertificate": "e31e242b-4eca-4309-921f-48cb72ec9bfb",
"transport": "sms",
"type": "Generic",
"url": "https://www.example.com/webhook"
}
}Delete the Generic Messenger#
Request#
Delete the Generic Messenger by its Id.
OpenAPI Spec
messengerIdThe Id of the Messenger to delete.
Response#
This API does not return a JSON response body.
| Code | Description |
|---|---|
| 200 | The request succeeded. |
| 400 | The request was invalid or malformed. The response contains an Errors JSON object with the specific errors. FusionAuth also returns a 400 when the request needs a paid FusionAuth license and no license is present. |
| 401 | FusionAuth didn't authorize the request. The Authorization header is missing, the API key isn't valid, or the API key doesn't have permission for this endpoint and method. The response is empty. For more information, see Unauthorized Responses. |
| 404 | The object you requested doesn't exist. The response is empty. |
| 500 | FusionAuth had an internal error and logged a stack trace in the FusionAuth log files. The response is empty. |
Related
Learn about the APIs for creating, retrieving, and updating Twilio Messengers.
Learn about the APIs for creating, retrieving, updating and deleting messengers.
Learn about the APIs for invoking a User Action on a User.
API documentation for the FusionAuth Create an API Key API.