POST /api/legals

Assigns a document as a legal agreement on the platform, and adds information about the agreement.

Before running this operation, you must upload the legal document using the content API. Follow these steps:

  1. Have the legal agreement in place. For supported file formats, see Legal Agreement Supported File Types.
  2. Upload the legal agreement to the resources/home/landing folder either via the user interface (More > Admin > File Manager, Content section, File Manager button, navigate down to home/landing folder) or by using the Content API, POST /content/{path} operation.
  3. Assign the new document to be a platform legal agreement by running this operation.

Note: First, make sure there isn't already a portal signup legal agreement. The API platform allows only one signup agreement. If there is one already existing, you'll have to deactivate it first. For instruction on how to do that in the Community Manager developer portal, refer to the Community Manager developer portal Site Admin help. To deactivate/update using the API, use the PUT /api/legals/{LegalDocumentID} operation.

Authorization Roles/Permissions: Must be logged in. Site Admin

This topic includes the following sections:

HTTP Method

POST

URL

https://{hostname}/api/legals

Sample Request

The example below adds a signup agreement to the platform. The request content is sent in JSON format.

Sample Request URL

https://{hostname}/api/legals?Accept=*/*&Content-Type=application/json

Sample request headers

Content-Type: application/json
Accept: text/plain
X-Csrf-Token_acmepaymentscorp: TokenID%3D8ed70a13-8469-11e8-b37a-b155e4eabeb8%2CexpirationTime%3D153...

Sample request body

{
  "Name" : "acmepaymentscorp Community Manager developer portal End-User License Agreement",
  "Description" : "End-User license agreement for acmepaymentscorp Community Manager developer portal",
  "AgreementType" : "com.soa.atmosphere.legals.signup",
  "ContentPath" : "/system/agreements/platform_agreement_acmepaymentscorp.txt",
  "Active" : true,
  "PrintContentPath" : "/system/agreements/platform_agreement_acmepaymentscorp.txt",
  "DocumentState" : "com.soa.status.active",
  "FileName" : "platform_agreement_acmepaymentscorp.txt"
}

Request Headers

For general information on request header values, refer to HTTP Request Headers.

Header Description
Accept Any Accept header value that supports a response Content-Type of text/plain is valid; for example, */*.
Content-Type

Any one of the following media types is valid for the request Content-Type:

application/json

application/vnd.soa.v71+json or application/vnd.soa.v71+xml

application/vnd.soa.v72+json or application/vnd.soa.v72+xml

application/vnd.soa.v80+json or application/vnd.soa.v80+xml

application/vnd.soa.v81+json or application/vnd.soa.v81+xml

Cookie AtmoAuthToken_{fedmemberid}={cookie value, which usually starts with TokenID}—The platform cookie. This is the Akana API Platform authorization token, and must be sent with every API request that requires login. For more information and an example, see Session cookies.
X-Csrf-Token_{fedmemberID} The CSRF prevention header; may or may not be required, depending on platform settings. See CSRF Prevention on the Platform. By default, the CSRF header is not required for GET operations and is required for all others, with a few exceptions relating to user login.

Request Parameters

Parameter Parm Type Data Type Required Description
AgreementDocument POST AgreementDocument Required Contains information about a platform legal agreement document.

Response

If successful, this operation returns HTTP status code 201, with the LegalDocumentID assigned to the agreement.

Sample Response

The sample response below shows successful completion of this operation.

Sample response headers

Status Code: 201 Created
Date: Thu, 03 Jan 2019 00:58:53 GMT
Location: {hostname}/api/legals/aea331fc-6081-4b14-bf05-ae69d68cd475.acmepaymentscorp

Sample response body

aea331fc-6081-4b14-bf05-ae69d68cd475.acmepaymentscorp

Response Headers

For general information on response header values, refer to HTTP Response Headers.

Header Description
Content-Type text/plain

Response Body

Name Type Description
LegalDocumentID String The unique ID for the association of a specific legal document with a resource such as an API version, license, or the platform.

Error Codes/Messages

If the call is unsuccessful an error code/message is returned. One or more examples of possible errors for this operation are shown below.

Item Value
401 Unauthorized. For example, you would get this response if you didn't include the custom X-Csrf-Token_{fedmemberID} header in the request, when it was required by the platform settings; or if you included an invalid or expired value for this header. You would also get this response for any operation that requires login (almost all) if the login cookie was missing.
405 Method Not Allowed. You might get this if there is an error in the URL, or if you used the wrong HTTP verb.
415 Unsupported Media Type; returned if the request is using a media type not supported by the method. For example, you would get this response if you used an unsupported media type for the Accept header.
500 An error occurred processing the call.

More information about Akana API Platform API error messages.