Create note

The Create note method is used to add a note to an entity in the platform.

An API token of a manager is required for authorization. To get an API token via the Operator Control Panel, see Viewing and updating manager's information

The manager's API token specified in an API request determines:

  • The role and access level of the manager, which determine the availability of a method.
  • The current reseller and downstream resellers accessible within a method.

POST {base_url}/api/v3/resellers/{reseller_id}/notes

Arguments

Name

Parameter Type

Data type

Required/Optional

Description

X-Api-TokenheaderstringRequiredAPI token of a manager that performs the operation (see Viewing and updating manager's information)
Content-TypeheaderstringRequiredMedia type of the request. Specify the following: application/vnd.api+json
AcceptheaderstringRequired

Supported media types of the answer. Specify the following: application/vnd.api+json

base_urlpathstringRequiredActivePlatform URL
reseller_idpathintegerRequiredThe ID of the current reseller or any of its downstream resellers (see Viewing and updating reseller general information)
idformintegerRequiredThe ID of the target entity in the platform
typeformstringRequired

The type of the target entity in the platform:

  • account.
  • subscription.
  • order.
contentformstringRequiredThe text of the note up to 5000 characters
attachmentformobjectOptionalInformation about a file attached to the note

nameformstringOptionalRequired if attachment presents. The name and extension of the attached file

dataformstringOptional

Required if attachment presents. The attached file in the base64 encoding, including its MIME-type (see Media type). 

The data format:

data:<MIME-type>;base64,'base64 file contents'

Response model

The successful response includes information about the created note, similar to the Get note method. Status: 201 Created.

Request example

POST /api/v3/resellers/1/notes
Host: test.activeplatform.com
Content-Type: application/vnd.api+json
X-Api-Token: vY5fwetestK3gJXZH5uHCw
Accept: application/vnd.api+json
{
  "data": {
    "attributes": {
      "id": 3056,
      "type": "subscription",
      "content": "Migrated 01.03.2022",
            "attachment":
            {
                "name": "ai_pine.pdf",
                "data": "data:application/pdf;base64,'SSBob2xkIHRoZSBwb3NpdGlvbiBvZiBhIHFhIGVuZ2luZWVyLiBRQSBlbmdpbmVlciByZXNwb25zaWJpbGl0aWVzIGluY2x1ZGUgZGVzaWduaW5nIGFuZCBpbXBsZW1lbnRpbmcgdGVzdHMsIGRlYnVnZ2luZyBhbmQgZGVmaW5pbmcgY29ycmVjdGl2ZSBhY3Rpb25zLiBJIGFsc28gcmV2aWV3IHN5c3RlbSByZXF1aXJlbWVudHMgYW5kIHRyYWNrIHF1YWxpdHkgYXNzdXJhbmNlIG1ldHJpY3MgKGUuZy4gZGVmZWN0IGRlbnNpdGllcyBhbmQgb3BlbiBkZWZlY3QgY291bnRzLikgVGhlIFFBIHRlY2huaWNpYW4gcm9sZSBwbGF5cyBhbiBpbXBvcnRhbnQgcGFydCBpbiBvdXIgY29tcGFueeKAmXMgcHJvZHVjdCBkZXZlbG9wbWVudCBwcm9jZXNzLg=='"
            }
        }
    }
}

Response example

{
    "data": {
        "id": "15",
        "type": "notes",
        "attributes": {
            "created_at": "2023-03-27T11:35:12.509+03:00",
            "updated_at": "2023-03-27T11:35:12.509+03:00",
            "content": "Migrated 01.03.2022",
            "creator": "Bill Smith",
            "original_link": "/admin/subscription/3056/notes/15",
            "original_id": 3056,
            "original_type": "Subscription",
            "attachment": {
                "name": "ai_pine.pdf",
                "url": "https://storage.test.activeplatform.com/private/uploads/note/attachment/15/ai_pine?expires=1680009898&hash=DStusb6w",
                "size": 3439
            }
        }
    }
}