<commit_before>---
title: Getting Started with the Notifications Service
---

This guide is intended to walk you through using the Notifications Service.<%= vars.notifications_api_1 %>

We'll show you how to set up the service through the following example: Darla is a cloud operator who needs to take the system down for maintenance and wants to notify everybody about her intentions.

##<a id='prereqs'></a> Prerequisites ##

Prior to using the Notifications service, Darla must have done the following:

- Installed Pivotal Cloud Foundry
- Set up an `admin` account on her Cloud Foundry instance
- <%= vars.notifications_service %>
- Installed the [cf](https://github.com/cloudfoundry/cli) and [uaac](https://rubygems.org/gems/cf-uaac) command line tools

##<a id='create-client'></a>Create your Client and Get a Token ##

To interact with the Notifications service, Darla needs certain [UAA](../concepts/architecture/uaa.html) scopes (authorities). Rather than use her `admin` user account directly, she creates a `notifications-admin` client with the required scopes:

<pre class='terminal'>
$ uaac client add notifications-admin --authorized_grant_types client_credentials --authorities \
    notifications.manage,notifications.write,notification_templates.write,notification_templates.read,critical_notifications.write
</pre>

It's worth noting that she doesn't need all of these scopes just to send a notification. `notifications.manage` is used to update notifications and assign templates for that notification. `notification_templates.write` allows Darla to custom-make her own template for a notification, and `notification_templates.read` allows her to check which templates are saved in the database. Finally, `notifications.write` is the scope necessary to send a notification to a user, space, everyone in the system, and more.

Now, Darla logs in using her newly created client:
<commit_msg>add whitespace to notifications.html to properly space template variable<commit_after>---
title: Getting Started with the Notifications Service
---

This guide is intended to walk you through using the Notifications Service. 
<%= vars.notifications_api_1 %>

We'll show you how to set up the service through the following example: Darla is a cloud operator who needs to take the system down for maintenance and wants to notify everybody about her intentions.

##<a id='prereqs'></a> Prerequisites ##

Prior to using the Notifications service, Darla must have done the following:

- Installed Pivotal Cloud Foundry
- Set up an `admin` account on her Cloud Foundry instance
- <%= vars.notifications_service %>
- Installed the [cf](https://github.com/cloudfoundry/cli) and [uaac](https://rubygems.org/gems/cf-uaac) command line tools

##<a id='create-client'></a>Create your Client and Get a Token ##

To interact with the Notifications service, Darla needs certain [UAA](../concepts/architecture/uaa.html) scopes (authorities). Rather than use her `admin` user account directly, she creates a `notifications-admin` client with the required scopes:

<pre class='terminal'>
$ uaac client add notifications-admin --authorized_grant_types client_credentials --authorities \
    notifications.manage,notifications.write,notification_templates.write,notification_templates.read,critical_notifications.write
</pre>

It's worth noting that she doesn't need all of these scopes just to send a notification. `notifications.manage` is used to update notifications and assign templates for that notification. `notification_templates.write` allows Darla to custom-make her own template for a notification, and `notification_templates.read` allows her to check which templates are saved in the database. Finally, `notifications.write` is the scope necessary to send a notification to a user, space, everyone in the system, and more.

Now, Darla logs in using her newly created client:

{'fraction_non_alphanumeric': 0.07815321124580861, 'fraction_numerical': 0.0005158627805003869, 'mean_word_length': 5.214743589743589, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '631214', 'n_tokens_mistral': 1028, 'n_tokens_neox': 976, 'n_words': 454}