Skip to main content

Integrate via API

Before you begin

Your Account Manager will provide you with:

  1. token. This token will let you access your projects & data. You have to add thе token to each request in Authorization HTTP-header;
caution

Keep your token in a safe storage and do not publish it anywhere. If the token has been compromised, contact us immediately to drop it and issue a new one. Also, always use HTTPS protocol to keep the connection safe.

  1. project_ID. This ID will be used to associate the content you send to Membrace with your specific project, which in turn lets us know what kind of moderation to perform on the content.

Sync API implies that as soon as you send us your content, you immediately some kind of response. Responses may vary depending on the specifics of your project.

Structure

POST /v1/item/process
Host: https://api.membrace.ai
Authorization: <token>

Payload

{
"request_id": "42",
"project_id": <project_id>,
"project_version": "1",
"content": <content>
}
  • request_id - String. Optional. This represents the content item ID in your system;
  • project_id - String. Required;
  • project_version - String. Required. Version of the project, initial value "1";
  • content - JSON. Required. Your content, structured in accordance with your project.

Response

{
"request_id": "42",
"item_id": <item_id>,
"project_id": "text",
"project_version": "1",
"status": "SUCCESS",
"result": <result>,
"error": <error>
}
  • request_id - String. Optional. Same ID as the one you've sent our way;
  • item_id - String. Auto generated UUID-4 string, ID in Membrace system;
  • status - String. Moderation task status (SUCCESS or FAILED);
  • result - JSON. Result of moderation, structure specified for your project. Appears only if status is SUCCESS;
  • error - JSON. Optional. Error message. Appears only if status returned FAILED. Possible types of moderation errors are given in the table:
Type of errorDescription
DOWNLOAD_ERRORFailed to upload image by link.
MODERATION_ERRORОne of the moderation modules worked incorrectly.
INTERNAL_ERROR Any other problem with the service.

If you received error type MODERATION_ERROR or INTERNAL_ERROR, contact to the support service.

Examples

In this case project_id = text.

Request

{
"request_id": "42",
"project_id": "text",
"project_version": "1",
"content": {
"text": "Hello world"
}
}
{
"request_id": "42",
"item_id": "a8688067-af4c-4c6b-b37e-a9c0e878e27b",
"project_id": "text",
"project_version": "1",
"status": "SUCCESS",
"result": {
"alcohol": false,
"clean_text": true,
"clickbait": false,
"drugs": false,
"erotica": false,
"explicit": false,
"insult": false,
"insult_light": false,
"insult_strong": false,
"obscene_light": false,
"obscene_strong": false,
"personal_data": false,
"swearing": false
}
}