GetUserProfile

GET /users/{username}/profile

Returns the user profile. Returns all its products including those sold

Path parameters

  • username string Required

Responses

  • 200 application/json

    OK

    Hide response attributes Show response attributes object
    • _id string
    • username string
    • firstName string
    • createDate string(date-time)
    • location string
    • image string
    • emailVerified boolean
    • products array[object]

      Product model

      Hide products attributes Show products attributes object
      • _id string Required
      • publisherId object Required

        User schema

        Hide publisherId attributes Show publisherId attributes object
        • _id string Required

          Unique identifier for the given user.

        • firstName string Required

          Minimum length is 2, maximum length is 30.

        • email string(email) Required
        • username string Required

          Unique identifier for the given user.

        • password string(password) Required
        • lastName string Required

          Minimum length is 2, maximum length is 30.

        • dateOfBirth string(date-time) Required
        • emailVerified boolean

          Set to true if the user's email has been verified.

        • createDate string(date)

          The date that the user was created.

        • location string
        • image string
      • images array[string(uri)]
      • title string Required
      • size string
      • price number Required
      • type string Required

        Values are plant or insect.

      • description string

        Maximum length is 500.

      • publishedDate string(date)
      • sold boolean
      • category object
        Hide category attributes Show category attributes object
        • type string Required

          Values are plant or insect.

        • category string Required

          Minimum length is 2, maximum length is 20.

        • subcategory string

          Minimum length is 2, maximum length is 20.

  • 404

    Not Found

  • 500

    Internal Server Error

GET /users/{username}/profile
curl \
 --request GET 'https://garden-to-yours.herokuapp.com/users/{username}/profile' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "_id": "string",
  "image": "string",
  "location": "string",
  "products": [
    {
      "_id": "string",
      "size": "string",
      "sold": true,
      "type": "plant",
      "price": 0,
      "title": "string",
      "images": [
        "http://example.com"
      ],
      "category": {
        "type": "plant",
        "category": "string",
        "subcategory": "string"
      },
      "description": "string",
      "publisherId": {
        "_id": "string",
        "email": "user@example.com",
        "image": "string",
        "lastName": "string",
        "location": "string",
        "password": "pa$$word",
        "username": "string",
        "firstName": "string",
        "createDate": "2019-08-24",
        "dateOfBirth": "2000-08-24T00:00:00.000Z",
        "emailVerified": true
      },
      "publishedDate": "2019-08-24"
    }
  ],
  "username": "string",
  "firstName": "string",
  "createDate": "2019-08-24T14:15:22Z",
  "emailVerified": true
}