Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Notifications project
web-portal
Commits
f5a15651
Commit
f5a15651
authored
Apr 12, 2022
by
Caetan Tojeiro Carpente
Committed by
Carina Antunes
Apr 25, 2022
Browse files
Changed example order
parent
75dd1105
Pipeline
#3888859
skipped with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/about/components/AboutAPI.js
View file @
f5a15651
...
...
@@ -32,7 +32,8 @@ Authorization: Bearer '<api-key>'
)}
</pre>
</Message>
Curl example:
<br />
Curl example for a targeted notification:
<Message>
<pre>{`curl -X POST ${process.env.REACT_APP_BASE_URL}/notifications ${
'
\\
'
}
-H "Content-Type: application/json" ${
'
\\
'
}
...
...
@@ -40,13 +41,16 @@ Authorization: Bearer '<api-key>'
--insecure ${
'
\\
'
}
--data
'
{
"
target
"
:
'
channel id that you can find in your browser url bar
'
"
summary
"
:
"
Test notification
"
,
"
summary
"
:
"
Test
targeted
notification
"
,
"
priority
"
:
"
NORMAL
"
,
"
body
"
:
"
<p>This is a test notification sent via the API</p>
"
}
'
`}</pre>
"
body
"
:
"
<p>This is a test targeted notification sent via the API</p>
"
,
"
private
"
:
true
,
"
targetUsers
"
:
[{
"
email
"
:
""
some
-
member
@
some
.
domain
"
}, ...],
"
targetGroups
"
: [{
"
groupIdentifier
"
:
"
some
-
group
"
}, ...],
"
intersection
"
: true,
}' `}</pre>
</Message>
Curl example for a targeted notification:
Curl example for a
basic (un
targeted
)
notification:
<Message>
<pre>{`curl -X POST ${process.env.REACT_APP_BASE_URL}/notifications ${'
\\
'}
-H
"
Content
-
Type
:
application
/
json
"
${'
\\
'}
...
...
@@ -54,15 +58,11 @@ Authorization: Bearer '<api-key>'
--insecure ${'
\\
'}
--data '{
"
target
"
: 'channel id that you can find in your browser url bar'
"
summary
"
:
"
Test
targeted
notification
"
,
"
summary
"
:
"
Test
notification
"
,
"
priority
"
:
"
NORMAL
"
,
"
body
"
:
"
<p>This is a test targeted notification sent via the API</p>
"
,
"
private
"
:
true
,
"
targetUsers
"
:
[{
"
email
"
:
""
some
-
member
@
some
.
domain
"
}, ...],
"
targetGroups
"
: [{
"
groupIdentifier
"
:
"
some
-
group
"
}, ...],
"
targetData
"
: [
"
some
-
member
@
some
.
domain
"
,
"
some
-
group
"
, ...],
"
intersection
"
: true,
}' `}</pre>
"
body
"
:
"
<
p
>
This
is
a
test
notification
sent
via
the
API
<
/p>
"
}
'
`}</pre>
</Message>
Notes:
<br />
...
...
@@ -71,9 +71,6 @@ Authorization: Bearer '<api-key>'
<tt>targetGroups</tt>: can contain only group objects with a groupIdentifier containing the
name,
<br />
<tt>targetData</tt>: can contain mixed strings emails and group names (but degraded
performance therefore not the recommended option),
<br />
<tt>intersection</tt>: if <code>true</code>, the notification will be sent only to the
intersection between specified users or groups and channel members. If <code>false</code>, the
notification will be sent to all specified users or groups (users or groups will be added as
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment