Send notification

Details

URI /notification/party/<party_id>
Method POST
Parameters

userIdentifier=<user_id>
    Required; the user ID you want to use as credentials for this API call.This user should be a consumer user who has the necessary permissions on the data to work with. See Get userIdentifier for the steps required to get the userIdentifier value.

Returns 200 - Ok
401 - Not authorized
404 - Not found
500 - Server exception

Request body format


<Notification>
    <subject>Notification Subject goes in here</subject>
    <contentBody>Enter any text here, optionally including tokens: token0 = {0}. Token1 = {1}</contentBody>
    <artifactContextId>UUID of the subscription</artifactContextId>
    <!-- Each recipient must have an id and type. Only PERSON and ORGANIZATION are valid types. Notifications will be sent to valid recipients and an error message returned for the invalid ones. Response code 200 OK will be returned if there is at least one valid recipient.
    -->
    <recipient>
        <id>UUID of the recipient</id>
        <type>PERSON</type>
    </recipient>
    <recipient>
        <id>UUID of organization</id>
        <type>ORGANIZATION</type>
    </recipient>
    <!-- tokens must be specified if your contentBody contains tokens. No token validation is done.
     -->
    <tokens>
        <tokenSequence>0</tokenSequence>
        <value>Token 0 content</value>
    </tokens>
    <tokens>
        <tokenSequence>1</tokenSequence>
        <value>Token 1 content</value>
    </tokens>
</Notification>

Examples

The following URL was sent:

https://<host>:<port>/csa/rest/notification/party?userIdentifier=90cec3a03a93ef89013a93f07b880001

The following XML was sent in the request (note that the second recipient.id is bad):


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Notification>
    <subject>Test Subject</subject>
    <contentBody>Test content body, token0 = {0}. Token1 = {1}</contentBody>
    <recipient>
        <id>90cec3a03a93ef89013a93f07b880001</id>
        <type>PERSON</type>
    </recipient>
    <recipient>
        <id>bad org id</id>
        <type>ORGANIZATION</type>
    </recipient>
     <tokens>
        <tokenSequence>0</tokenSequence>
        <value>Token 0 test content</value>
    </tokens>
    <tokens>
        <tokenSequence>1</tokenSequence>
        <value>Token 1 test content</value>
    </tokens>
</Notification>

The following response header status code was returned: 200 OK

The following XML was returned:


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<NotificationPostResponse>
    <count>1</count>
    <errorMessage>Please enter a valid value for the recipient user id = bad org id</errorMessage>
    <notification>
        <notifContentBody>Test content body, token0 = {0}. Token1 = {1}</notifContentBody>
        <notifCreatedOn>2012-11-14T10:25:06.021-07:00</notifCreatedOn>
        <notifSubject>Test Subject</notifSubject>
        <notifactionId>90cec39c3ae64d82013afff3e9c3002c</notifactionId>
        </recepientArtifactTypeId>
            90d96588360da0c701360da0ef03002c
        </recepientArtifactTypeId>
        <recepientArtifactTypeName>PERSON</recepientArtifactTypeName>
        <recepientEmailAddr>
            acctgconsumer@econ-csa.com
        </recepientEmailAddr>
        <recepientId>90cec3a03a93ef89013a93f07b880001</recepientId>
        <recepientName>acctgconsumer</recepientName>
        <senderContextArtifactId>
            90cec3a03a93ef89013a93f07b880001
        </senderContextArtifactId>
        <senderContextArtifactTypeId>
            90d96588360da0c701360da0ef03002c
        </senderContextArtifactTypeId>
        <senderContextArtifactTypeName>
            PERSON
        </senderContextArtifactTypeName>
        <source>EXTERNAL</source>
        <tokens>
            <tokenSequence>1</tokenSequence>
            <value>Token 1 test content</value>
        </tokens>
        <tokens>
            <tokenSequence>0</tokenSequence>
            <value>Token 0 test content</value>
        </tokens>
    </notification>
</NotificationPostResponse>