Handle disclaimers

The disclaimers to be attached to your projects

A disclaimer is a list of information to be given to the investors of your project.

Authentication

cURL request

To be able to perform actions on our API, you need to be authenticated. To do this, use the following endpoint.

curl -XPOST 'https://primary-market-api-develop.tokeny.com/auth/local' \
--header 'Content-Type: application/json' \
--data-raw '{
    "identifier":"[email protected]",
    "password": "my-password"
}'

Sample response

{
    "jwt": "<jwt>",
    "user": {
        "id": 1,
        "username": "Username",
        "email": "[email protected]",
        "provider": "local",
        "confirmed": true,
        "blocked": false,
        "role": {
            "id": 34,
            "name": "Projects creators",
            "description": "Authors of projects, authenticated with the permission to manage projects, categories, issuers and disclaimers.",
            "type": "projects_manager"
        },
        "created_at": "2021-03-17T16:14:14.286Z",
        "updated_at": "2021-03-17T16:16:00.097Z"
    }
}

jwt is the jwt token that you will need to perform the next operations

Troubleshooting

{
    "statusCode": 400,
    "error": "Bad Request",
    "message": [
        {
            "messages": [
                {
                    "id": "Auth.form.error.invalid",
                    "message": "Identifier or password invalid."
                }
            ]
        }
    ],
    "data": [
        {
            "messages": [
                {
                    "id": "Auth.form.error.invalid",
                    "message": "Identifier or password invalid."
                }
            ]
        }
    ]
}

The status code can be either:

  • 400: one of the specified credential is wrong, please check them again. In case you lost your password, please contact [email protected]
  • 401: you are not allowed to connect to the API. If you think it is a mistake, please contact your administrator or [email protected]

Retrieve existing disclaimers

cURL

To retrieve the existing disclaimers, call the following endpoint

curl -XGET 'https://primary-market-api-develop.tokeny.com/disclaimers' \
--header 'Authorization: Bearer <jwt>'

jwt is the authentication token you received on the Authentication step.

Sample response

[
    {
        "id": 2,
        "disclaimer_content": "My first disclaimer with some content **and some styling** *Some other* <u>And last one</u> ~~Scratch that~~ \n - With non-numbered lists \n - and a second item \n 1. A numbered list \n 2. With another item \n ```Some more styling``` \n > An inspiring quote \n [And a link to your website](wwww.google.com) \n Images are also allowed",
        "published_at": "2021-03-18T10:33:44.740Z",
        "created_at": "2021-03-18T10:33:44.743Z",
        "updated_at": "2021-03-18T10:33:44.743Z"
    }
]

Troubleshooting

{
    "statusCode": 403,
    "error": "Forbidden",
    "message": "Forbidden"
}

statusCode can be:

  • 401: your authentication token is invalid or has expired. Please go back to the Authentication step and retry
  • 403: you are not authorized to access this resource. If you think this is an error, contact your administrator or [email protected]

Create a new disclaimer

cURL

To create a new disclaimer, call the following endpoint

curl -XPOST 'https://primary-market-api-develop.tokeny.com/disclaimers' \
--header 'Authorization: Bearer <jwt>' \
--header 'Content-Type: application/json' \
--data-raw '{
  "disclaimer_content": "<disclaimer_content>"
}'

jwt is the authentication token you received on the Authentication step.
disclaimer_content is the content you want to be displayed in your disclaimer. This field accepts markdown for the formatting.

Markdown example

My first disclaimer with some content **and some styling** *Some other* <u>And last one</u> ~~Scratch that~~ 
 - With non-numbered lists 
 - and a second item 
 1. A numbered list 
 2. With another item 
 ```Some more styling``` 
 > An inspiring quote 

 [And a link to your website](wwww.google.com) 

 Images are also allowed

Preview

13821382

Sample response

{
    "id": 3,
    "disclaimer_content": "My first disclaimer with some content **and some styling** *Some other* <u>And last one</u> ~~Scratch that~~ \n - With non-numbered lists \n - and a second item \n 1. A numbered list \n 2. With another item \n ```Some more styling``` \n > An inspiring quote \n\n [And a link to your website](wwww.google.com) \n Images are also allowed",
    "published_at": "2021-03-18T10:34:28.330Z",
    "created_at": "2021-03-18T10:34:28.333Z",
    "updated_at": "2021-03-18T10:34:28.333Z"
}

Troubleshooting

{
    "statusCode": 400,
    "error": "Bad Request",
    "message": "ValidationError",
    "data": {
        "errors": {
            "disclaimer_content": [
                "disclaimer_content must be defined."
            ]
        }
    }
}

statusCode can be:

  • 401: your authentication token is invalid or has expired. Please go back to the Authentication step and retry
  • 403: you are not authorized to access this resource. If you think this is an error, contact your administrator or [email protected]

Update an existing disclaimer

cURL

If you need to update the content of a disclaimer, use the following request.

curl -XPUT 'https://primary-market-api-develop.tokeny.com/disclaimers/<disclaimer_id>' \
--header 'Authorization: Bearer <jwt>' \
--header 'Content-Type: application/json' \
--data-raw '{
  "disclaimer_content": "<new_disclaimer_content>"
}'

jwt is the authentication token retrieved in the Authenticate step
disclaimer_id is the unique identifier of the category, retrieved though the "Retrieve the existing disclaimers" step, or the "Create new disclaimer" step.
new_disclaimer_content is the new name that you want to give to your category. As for the creation of the disclaimer, Markdown is supported here.

Sample response

{
    "id": 3,
    "disclaimer_content": "My first disclaimer with some content **and some styling** *Some other* <u>And last one</u> ~~Scratch that~~ \n - With non-numbered lists \n - and a second item \n 1. A numbered list \n 2. With another item \n ```Some more styling``` \n > An inspiring quote \n\n [And a link to your website](wwww.google.com) \n\n Images are also allowed",
    "published_at": "2021-03-18T10:34:28.330Z",
    "created_at": "2021-03-18T10:34:28.333Z",
    "updated_at": "2021-03-18T10:59:32.747Z"
}

Troubleshooting

{
    "statusCode": 403,
    "error": "Forbidden",
    "message": "Forbidden"
}

statusCode can be:

  • 400: you forgot to specify a mandatory field or the field doesn't match the validation rules
  • 401: your authentication token is invalid. Go back to the Authentication step and retry.
  • 403: you are not allowed to create categories. If you think this is an error, contact your administrator or [email protected]

What’s Next

You are now ready to create your project.