Details
Consumer API
>
API Reference
>
v0
>
Messages
>
Details
openapi: 3.0.0
info:
version: "1.0.0"
title: User Messages
servers:
- url: 'https://{API_ENVIRONMENT}/a/consumer/api/v0'
variables:
API_ENVIRONMENT:
default: digital.garden-fi.com
description: FI specific hostname
tags:
- name: Messages
- name: Image Proxy
paths:
"/messages/{userId}":
get:
tags:
- Messages
description: Same as the previous endpoint, except transforms the `messageHtml` to 1)
remove unsafe HTML and 2) convert any image URLs not in the Online CSP
into proxied URLs.
security:
- OpenID_Connect:
- 'https://api.banno.com/consumer/auth/user.messages.readonly'
- 'https://api.banno.com/consumer/auth/user.messages.write'
parameters:
- $ref: "#/components/parameters/userId"
responses:
"200":
description: OK
content:
application/json:
schema:
type: object
description: ""
required:
- messages
- inactiveMessageIds
properties:
messages:
type: array
items:
$ref: "#/components/schemas/Message"
"404":
description: Not found
"/users/{userId}/messages/{messageId}":
delete:
tags:
- Messages
description: Deactivates a message for a user
security:
- OpenID_Connect:
- 'https://api.banno.com/consumer/auth/user.messages.write'
parameters:
- $ref: "#/components/parameters/userId"
- $ref: "#/components/parameters/messageId"
responses:
"204":
description: NoContent -- Success
"404":
description: Message not found
put:
tags:
- Messages
description: Updates the 'read' field for a message with the given messageId.
security:
- OpenID_Connect:
- 'https://api.banno.com/consumer/auth/user.messages.write'
parameters:
- $ref: "#/components/parameters/userId"
- $ref: "#/components/parameters/messageId"
requestBody:
content:
application/json:
schema:
type: object
required:
- read
properties:
read:
type: boolean
description: Can take read value to set on the message
required: true
responses:
"204":
description: Message updated successfully
"503":
description: Something went wrong or timed out while processing
"/messages/{userId}/{messageId}":
get:
tags:
- Messages
description: Same as the previous GET endpoint, except transforms the `messageHtml`
to 1) remove unsafe HTML and 2) convert any image URLs not in the Online
CSP into proxied URLs.
security:
- OpenID_Connect:
- 'https://api.banno.com/consumer/auth/user.messages.readonly'
- 'https://api.banno.com/consumer/auth/user.messages.write'
parameters:
- $ref: "#/components/parameters/userId"
- $ref: "#/components/parameters/messageId"
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/Message"
"404":
description: Not found
'/messages/image':
get:
tags:
- Image Proxy
description: Image proxy. Used by the `/node/messages` endpoints.
security:
- OpenID_Connect:
- 'https://api.banno.com/consumer/auth/user.messages.readonly'
- 'https://api.banno.com/consumer/auth/user.messages.write'
parameters:
- in: query
name: url
description: The image URI to proxy
required: true
schema:
type: string
responses:
"200":
description: The proxied image
"400":
description: The `url` parameter is missing, or proxied URL is not an image
"401":
description: Authentication not found or invalid
"504":
description: Proxied URL did not respond in time
components:
securitySchemes:
OpenID_Connect:
type: openIdConnect
description: OpenID Connect - Discovery endpoint will be institution specific
openIdConnectUrl: >-
https://digital.garden-fi.com/a/consumer/api/v0/oidc/.well-known/openid-configuration
parameters:
userId:
in: path
name: userId
description: ID of the desired user
required: true
schema:
type: string
messageId:
in: path
name: messageId
description: ID of the message
required: true
schema:
type: string
schemas:
Message:
type: object
description: A single message.
required:
- id
- userId
- date
- title
- description
- messageHtml
properties:
id:
type: string
userId:
type: string
description: If the message object has a userId, it will not have an institutionId
date:
type: string
format: date-time
title:
type: string
description:
type: string
messageHtml:
type: string
read:
type: boolean
Have a Question?
Have a how-to question? Seeing a weird error? Get help on
StackOverflow.
Register for the Digital Toolkit Meetup
where we answer technical Q&A from the audience.
Last updated Thu May 27 2021