Create Picture

Create a photo for business or review or dish.

Parameters
  • dataformData, objectRequired

    Form Data needed when creating a new Picture.

    • typestringRequired

      Provide Picture type. Current selection is only pictures.

    • attributesformData, objectRequired

      Attributes object.

      • parent_resourcestringRequired

        Valid values: business, dish, point, chapter, blog_post, food_review, service_review, atmosphere_review, cleanliness_review, concept_review, pricing_review.

      • photofileRequired

        Upload a photo.

    • relationshipsformData, object

      Relationships object with business, Reviews or dish objects.

      • businessformData, object

        Add a Business relationships.

        • idstring

          Related Business id.

        • typestring

          Business type; business.

      • reviewformData, object

        Add a Review relationships link.

        • idstring

          Related Review id.

        • typestring

          Review type; review.

      • dishformData, object

        Add a Dish relationships link.

        • idstring

          Related Dish id.

        • typestring

          Dish type; dish.

POST/api/v1/pictures

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

  const data = await res.json();
}

RESPONSE


Delete Picture

Delete a Picture.

Parameters
  • idpath integerRequired

    Delete a Picture by specific id.

DELETE/api/v1/pictures/{id}

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