User by id

Return a User.

Parameters
  • idpath integerRequired

    Return a User by specific id.

  • includequery string

    Include associations (delimited with comma). Available associations: specializations

  • languagequery string

    Return results of Business by language ISO 639‑1 code.

GET/api/v1/users/{id}

{
  const res = await fetch(`${BASE_URL}/api/v1/users/${id}`, {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)});

  const data = await res.json();
}

RESPONSE


User Reviews

Return published reviews for the given user.

Parameters
  • idpath integerRequired

    Return a User by specific id.

  • includequery string

    Include associations (delimited with comma). Available associations: specializations

  • sortquery string

    Sort ascending or descending order.

  • pagequery integer

    Page offset to fetch.

  • per_pagequery integer

    Number of results to return per page.

GET/api/v1/users/{id}/reviews

{
  const res = await fetch(`${BASE_URL}/api/v1/users/${id}/reviews`, {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)});

  const data = await res.json();
}

RESPONSE


Request Object

The required Request Object.

REQUEST OBJECT

{
  "data": {
    "type": "users",
    "attributes": {
      "email": "email@gmail.com",
      "password": "userPassword",
      "password_confirmation": "userPassword",
      "terms_agreement": false,
      "source": "sherlock",
      "language": "en"
    }
  }
}

Create User

Create a User.

Parameters
  • dataformData, objectRequired

    Form Data needed when creating a new User.

    • typestringRequired

      Provide User type. Current selection is only users.

    • attributesformData, objectRequired

      Attributes object.

      • emailstringRequired

        Email address.

      • passwordstringRequired

        Password.

      • password_confirmationstringRequired

        Password confirmation.

      • terms_agreementbooleanRequired

        Terms & Conditions agreement.

      • terms_agreementstring

        Valid values: unknown, foodetective, mobile, lefood, sherlock

      • languagestring

POST/api/v1/users

{
  const res = await fetch(`${BASE_URL}/api/v1/users`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)});

  const data = await res.json();
}

RESPONSE


Confirm User

Confirm user with a token.

Parameters
  • dataformData, objectRequired

    Form Data needed when confirming user with a token.

    • typestringRequired

      Provide User type. Current selection is only users.

    • attributesformData, objectRequired

      Attributes object.

      • confirmation_tokenstringRequired

        Confirmation token.

POST/api/v1/users/confirm

{
  const res = await fetch(`${BASE_URL}/api/v1/users/confirm`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)});

  const data = await res.json();
}

RESPONSE


Confirmation Email

Request Confirmation Mail.

Parameters
  • dataformData, objectRequired

    Form Data needed when requesting Confirmation Mail.

    • typestringRequired

      Provide User type. Current selection is only users.

    • attributesformData, objectRequired

      Attributes object.

      • emailstringRequired

        Email address.

POST/api/v1/users/request_confirmation_mail

{
  const res = await fetch(`${BASE_URL}/api/v1/users/request_confirmation_mail`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)});

  const data = await res.json();
}

RESPONSE


Password Recover

Recover user's password.

Parameters
  • dataformData, objectRequired

    Form Data needed when recovering a user's password.

    • typestringRequired

      Provide User type. Current selection is only users.

    • attributesformData, objectRequired

      Attributes object.

      • emailstringRequired

        Email address.

POST/api/v1/users/request_reset_password

{
  const res = await fetch(`${BASE_URL}/api/v1/users/request_reset_password`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)});

  const data = await res.json();
}

RESPONSE


Password Reset

Reset user's password using reset password token from email.

Parameters
  • dataformData, objectRequired

    Form Data needed when reseting user's password using reset password token from email.

    • typestringRequired

      Provide User type. Current selection is only users.

    • attributesformData, objectRequired

      Attributes object.

      • reset_password_tokenstringRequired

        Reset password token.

      • passwordstringRequired

        New password.

      • password_confirmationstringRequired

        New password confirmation

PATCH/api/v1/users/reset_password_by_token

{
  const res = await fetch(`${BASE_URL}/api/v1/users/reset_password_by_token`, {
    method: 'PATCH',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)});

  const data = await res.json();
}

RESPONSE


Delete User

Delete unconfirmed user's account using delete token from email.

Parameters
  • dataformData, objectRequired

    Form Data needed when deleting unconfirmed user's account using delete token from email.

    • typestringRequired

      Provide User type. Current selection is only users.

    • attributesformData, objectRequired

      Attributes object.

      • delete_tokenstringRequired

        Delete user via delete token.

DELETE/api/v1/users/delete_by_token

{
  const res = await fetch(`${BASE_URL}/api/v1/users/delete_by_token`, {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json'
    }});
  const data = await res.json();
}