GET /api/legals?AgreementType={LegalAgreementType}

Returns information about all legal agreement documents matching the specified criteria, in the form of a JSON or XML object.

Authorization Roles/Permissions: Must be logged in and have permission to view the requested resources. If the user is logged in but doesn't have permission to view certain resources, the operation works, but limited (or empty) results are returned.

This topic includes the following sections:

HTTP Method

GET

URL

https://{hostname}/api/legals?AgreementType={LegalAgreementType}

Sample Request

The example below shows a request for any signup agreements on the platform.

Request URL #1

Requests information about the platform signup document.

https://{hostname}/api/legals?AgreementType=com.soa.atmosphere.legals.signup

Request URL #2

Requests information about the legal agreement for the specified API version.

https://{hostname}/api/legals?ResourceID=e55ec961-c4bc-4da5-b289-24d344a07cdd.acmepaymentscorp

Sample request headers

Accept: application/vnd.soa.v81+xml

Sample request body

Not applicable.

Request Headers

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

Header Description
Accept

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

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

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

application/vnd.soa.v81+json, 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
AgreementType Query string Required

The type of legal agreement to be returned in the response. For valid values, refer to Legal Agreement Types.

Required unless ResourceID parameter is present.

ResourceID Query string Optional

The unique ID for a specific resource; for example, the ScopeID or the APIVersionID.

In this case it is the LegalDocumentID for a specific legal agreement document.

Required if AgreementType parameter is not present.

Response

If successful, this operation returns HTTP status code 200, with the legal agreement information.

Sample Response

The sample response below shows successful completion of this operation.

Sample response headers: application/vnd.soa.v81+json

Status Code: 200 OK
Content-Type: application/vnd.soa.v81+json
Date: Thu, 11 Jan 2018 17:56:33 GMT

Sample response body: application/vnd.soa.v81+json

{
  "AgreementDocument":[
    {
      "DocumentID":"29b619ed-b4ee-4a5c-b6dc-695714c087a4.acmepaymentscorp",
      "Name":"SwaggerPetstoreLegal",
      "Description":"SwaggerPetstoreLegal",
      "AgreementType":"com.soa.atmosphere.legals.eula",
      "ResourceID":"e55ec961-c4bc-4da5-b289-24d344a07cdd.acmepaymentscorp",
      "ResourceType":"apiversion",
      "ContentPath":"api/90280da2-c33d-45c0-8ce3-93fb930dbb97.acmepaymentscorp/legal/legalagreement.txt",
      "MetadataResourceURI":"tenants/acmepaymentscorp/content/api/90280da2-c33d-45c0-8ce3-93fb930dbb97.acmepaymentscorp/legal/legalagreement.txt",
      "MetadataResourceVersion":1,
      "Active":true,
      "PrintContentPath":"api/90280da2-c33d-45c0-8ce3-93fb930dbb97.acmepaymentscorp/legal/legalagreement.txt",
      "PrintResourceURI":"tenants/acmepaymentscorp/content/api/90280da2-c33d-45c0-8ce3-93fb930dbb97.acmepaymentscorp/legal/legalagreement.txt",
      "PrintVersion":1,
      "DocumentState":"com.soa.status.active",
      "FileName":"legalagreement.txt",
      "Link":"api/90280da2-c33d-45c0-8ce3-93fb930dbb97.acmepaymentscorp/legal/legalagreement.txt?version=1",
      "TargetResources":{
        "TargetResource":[
          {
            "Name":"Swagger_Petstore_Subset",
            "ID":"90280da2-c33d-45c0-8ce3-93fb930dbb97.acmepaymentscorp",
            "Type":"api"
          }
        ]
      }
    }
  ]
}

Response Headers

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

Header Description
Content-Type

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

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

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

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

Response Body

Name Type Description
AgreementDocuments AgreementDocuments Contains Information about the legal agreement documents matching the specified criteria.

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.
500 An error occurred processing the call.

More information about Akana API Platform API error messages.