Faq (Admin)

Companies can create some FAQ context and maintain its FAQ items. This module makes possible to manipulate that entities.

A FAQ item can be associated to one or more contexts and it is technically independent of a context. You can see the model representation bellow.

Data modelling of FAQ system

FAQ items entities are I18n compliant.

FAQ Model (Example)
{
  "id": "e9aa37cd-0d43-425e-828a-1fda093cbdf1",
  "createdAt": "2022-09-15T14:19:47.052Z",
  "updatedAt": "2022-09-15T14:19:47.052Z",
  "context": {
    "id": "e9aa37cd-0d43-425e-828a-1fda093cbdf2",
    "createdAt": "2022-09-15T14:19:47.052Z",
    "updatedAt": "2022-09-15T14:19:47.052Z",
    "name": "pre-sale"
  }
  "question": {
    "pt-br": "Como comprar?",
    "en": "How to purchase?"
  },
  "answer": {
    "pt-br": "Basta colocar o cartao de credito e pagar que adicionamos a sua wallet.",
    "en": "You can put your items into your cart, click on purchase and pay with your credit card."
  },
  "externalUrl": "https://w3block.io/faqitem"
}

Service Methods

Creates a new FAQ context inside a company

Rest API reference:

post

Creates a new FAQ context for a company

Authorizations
Path parameters
companyIdstringRequired
Body
namestringRequiredExample: pre_sale
Responses
201Success
application/json
post
POST /admin/companies/{companyId}/faq/contexts HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 19

{
  "name": "pre_sale"
}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "createdAt": "2025-07-05T08:14:28.420Z",
  "updatedAt": "2025-07-05T08:14:28.420Z",
  "companyId": "123e4567-e89b-12d3-a456-426614174000",
  "company": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "createdAt": "2025-07-05T08:14:28.420Z",
    "updatedAt": "2025-07-05T08:14:28.420Z",
    "name": "text"
  },
  "name": "pre_sale"
}

Lists all company FAQ contexts

Rest API reference:

get

Lists all company FAQ contexts

Authorizations
Path parameters
companyIdstringRequired
Query parameters
pagenumberOptionalDefault: 1
limitnumberOptionalDefault: 10
searchstringOptional
sortBystringOptional
orderBystring · enumOptionalPossible values:
Responses
200Success
application/json
get
GET /admin/companies/{companyId}/faq/contexts HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*
{
  "items": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "createdAt": "2025-07-05T08:14:28.420Z",
      "updatedAt": "2025-07-05T08:14:28.420Z",
      "companyId": "123e4567-e89b-12d3-a456-426614174000",
      "company": {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "createdAt": "2025-07-05T08:14:28.420Z",
        "updatedAt": "2025-07-05T08:14:28.420Z",
        "name": "text"
      },
      "name": "pre_sale"
    }
  ],
  "meta": {
    "itemCount": 1,
    "totalItems": 1,
    "itemsPerPage": 1,
    "totalPages": 1,
    "currentPage": 1
  },
  "links": {
    "first": "http://example.com?page=1",
    "prev": "http://example.com?page=1",
    "next": "http://example.com?page=2",
    "last": "http://example.com?page=3"
  }
}

Gets some company FAQ context by ID

Rest API reference:

get

Gets a company FAQ context

Authorizations
Path parameters
companyIdstringRequired
contextIdstringRequired
Responses
200Success
application/json
get
GET /admin/companies/{companyId}/faq/contexts/{contextId} HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "createdAt": "2025-07-05T08:14:28.420Z",
  "updatedAt": "2025-07-05T08:14:28.420Z",
  "companyId": "123e4567-e89b-12d3-a456-426614174000",
  "company": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "createdAt": "2025-07-05T08:14:28.420Z",
    "updatedAt": "2025-07-05T08:14:28.420Z",
    "name": "text"
  },
  "name": "pre_sale"
}

Updates some company FAQ context

Rest API reference:

patch

Updates some company FAQ context

Authorizations
Path parameters
companyIdstringRequired
contextIdstringRequired
Body
namestringRequiredExample: pre_sale
Responses
200Success
application/json
patch
PATCH /admin/companies/{companyId}/faq/contexts/{contextId} HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 19

{
  "name": "pre_sale"
}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "createdAt": "2025-07-05T08:14:28.420Z",
  "updatedAt": "2025-07-05T08:14:28.420Z",
  "companyId": "123e4567-e89b-12d3-a456-426614174000",
  "company": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "createdAt": "2025-07-05T08:14:28.420Z",
    "updatedAt": "2025-07-05T08:14:28.420Z",
    "name": "text"
  },
  "name": "pre_sale"
}

Lists all FAQ context items

Rest API reference:

get

Lists all FAQ items inside some company context

Authorizations
Path parameters
companyIdstringRequired
contextIdstringRequired
Query parameters
pagenumberOptionalDefault: 1
limitnumberOptionalDefault: 10
searchstringOptional
sortBystringOptional
orderBystring · enumOptionalPossible values:
Responses
200Success
application/json
get
GET /admin/companies/{companyId}/faq/contexts/{contextId}/items HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*
{
  "items": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "createdAt": "2025-07-05T08:14:28.420Z",
      "updatedAt": "2025-07-05T08:14:28.420Z",
      "question": {
        "pt-br": "Algum texto em pt-br",
        "en": "Some text in en"
      },
      "answer": {
        "pt-br": "Algum texto em pt-br",
        "en": "Some text in en"
      },
      "externalUrl": "https://myquestion.should.move.to/"
    }
  ],
  "meta": {
    "itemCount": 1,
    "totalItems": 1,
    "itemsPerPage": 1,
    "totalPages": 1,
    "currentPage": 1
  },
  "links": {
    "first": "http://example.com?page=1",
    "prev": "http://example.com?page=1",
    "next": "http://example.com?page=2",
    "last": "http://example.com?page=3"
  }
}

Gets some specific FAQ item by ID from some FAQ context

Rest API reference:

get

Gets company context FAQ item by id

Authorizations
Path parameters
companyIdstringRequired
contextIdstringRequired
faqItemIdstringRequired
Responses
200Success
application/json
get
GET /admin/companies/{companyId}/faq/contexts/{contextId}/items/{faqItemId} HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "createdAt": "2025-07-05T08:14:28.420Z",
  "updatedAt": "2025-07-05T08:14:28.420Z",
  "question": {
    "pt-br": "Algum texto em pt-br",
    "en": "Some text in en"
  },
  "answer": {
    "pt-br": "Algum texto em pt-br",
    "en": "Some text in en"
  },
  "externalUrl": "https://myquestion.should.move.to/"
}

Creates a FAQ item and associate it to one or more contexts

Rest API reference:

post

Creates a new FAQ item inside one or more company contexts

Authorizations
Path parameters
companyIdstringRequired
Body
externalUrlstringOptionalExample: https://myquestion.should.move.to/
Responses
201Success
application/json
post
POST /admin/companies/{companyId}/faq/items HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 257

{
  "question": {
    "pt-br": "Algum texto em pt-br",
    "en": "Some text in en"
  },
  "answer": {
    "pt-br": "Algum texto em pt-br",
    "en": "Some text in en"
  },
  "externalUrl": "https://myquestion.should.move.to/",
  "contexts": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "relevance": 0
    }
  ]
}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "createdAt": "2025-07-05T08:14:28.420Z",
  "updatedAt": "2025-07-05T08:14:28.420Z",
  "question": {
    "pt-br": "Algum texto em pt-br",
    "en": "Some text in en"
  },
  "answer": {
    "pt-br": "Algum texto em pt-br",
    "en": "Some text in en"
  },
  "externalUrl": "https://myquestion.should.move.to/"
}

Lists all FAQ items available in the company independent of context

Rest API reference:

get

Lists all company FAQ items which are associated to some company context

Authorizations
Path parameters
companyIdstringRequired
Query parameters
pagenumberOptionalDefault: 1
limitnumberOptionalDefault: 10
searchstringOptional
sortBystringOptional
orderBystring · enumOptionalPossible values:
Responses
200Success
application/json
get
GET /admin/companies/{companyId}/faq/items HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*
{
  "items": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "createdAt": "2025-07-05T08:14:28.420Z",
      "updatedAt": "2025-07-05T08:14:28.420Z",
      "question": {
        "pt-br": "Algum texto em pt-br",
        "en": "Some text in en"
      },
      "answer": {
        "pt-br": "Algum texto em pt-br",
        "en": "Some text in en"
      },
      "externalUrl": "https://myquestion.should.move.to/"
    }
  ],
  "meta": {
    "itemCount": 1,
    "totalItems": 1,
    "itemsPerPage": 1,
    "totalPages": 1,
    "currentPage": 1
  },
  "links": {
    "first": "http://example.com?page=1",
    "prev": "http://example.com?page=1",
    "next": "http://example.com?page=2",
    "last": "http://example.com?page=3"
  }
}

Gets some FAQ item of company by ID

Rest API reference:

get

Gets a company FAQ item by id

Authorizations
Path parameters
companyIdstringRequired
faqItemIdstringRequired
Responses
200Success
application/json
get
GET /admin/companies/{companyId}/faq/items/{faqItemId} HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "createdAt": "2025-07-05T08:14:28.420Z",
  "updatedAt": "2025-07-05T08:14:28.420Z",
  "question": {
    "pt-br": "Algum texto em pt-br",
    "en": "Some text in en"
  },
  "answer": {
    "pt-br": "Algum texto em pt-br",
    "en": "Some text in en"
  },
  "externalUrl": "https://myquestion.should.move.to/"
}

Updates some FAQ item, including re-association of contexts

Rest API reference:

patch

Updates some FAQ item and associate/disassociate it contexts

Authorizations
Path parameters
companyIdstringRequired
faqItemIdstringRequired
Body
externalUrlstringOptionalExample: https://myquestion.should.move.to/
Responses
200Success
application/json
patch
PATCH /admin/companies/{companyId}/faq/items/{faqItemId} HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 257

{
  "question": {
    "pt-br": "Algum texto em pt-br",
    "en": "Some text in en"
  },
  "answer": {
    "pt-br": "Algum texto em pt-br",
    "en": "Some text in en"
  },
  "externalUrl": "https://myquestion.should.move.to/",
  "contexts": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "relevance": 0
    }
  ]
}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "createdAt": "2025-07-05T08:14:28.420Z",
  "updatedAt": "2025-07-05T08:14:28.420Z",
  "question": {
    "pt-br": "Algum texto em pt-br",
    "en": "Some text in en"
  },
  "answer": {
    "pt-br": "Algum texto em pt-br",
    "en": "Some text in en"
  },
  "externalUrl": "https://myquestion.should.move.to/"
}

Last updated