API documentation

Gifts

Overview

The Gift object allows to record gifts you have offered, or wish to offer to your contacts. A gift has to be associated with an existing contact - it can't be orphan.

Apart from being linked to a contact, a gift can also be linked to a partner or a child of the given contact. This is defined by the is_for tab.

When retrieving a gift, we always also return some basic information about the related contact.

List all the gifts in your account

GET /gifts/

Parameters

Name Type Description
limit integer Indicates the page size.
page integer Indicates the page to return.

Response

{
  "data": [
    {
      "id": 1,
      "object": "gift",
      "name": "Nice gift for Dwight",
      "comment": "I'm sure he'll love it",
      "url": "https:\/\/www.amazon.ca\/Culturenik-815-640-AMA-Office-Worlds-Television\/dp\/B00PCVCW80\/ref=sr_1_1?ie=UTF8&qid=1508272830&sr=8-1&keywords=dunder+mifflin+mug",
      "amount": "123",
      "amount_with_currency": "$123.00",
      "status": "idea",
      "date": null,
      "recipient": null,
      "photos": [],
      "contact": {
        "id": 1,
        "object": "contact",
        "first_name": "Henri",
        "last_name": "Troyat",
        "gender": "male",
        "is_partial": false,
        "information": {
          "dates": [
            {
              "name": "birthdate",
              "is_birthdate_approximate": "approximate",
              "birthdate": "1987-01-01T21:56:44Z"
            }
          ]
        },
        "account": {
          "id": 5
        }
      },
      "account": {
        "id": 5
      },
      "created_at": "2017-10-17T16:40:38Z",
      "updated_at": "2017-10-17T16:40:38Z"
    },
    {
      "id": 2,
      "object": "gift",
      "name": "For my friend Ron Swanson",
      "comment": "",
      "url": "https:\/\/www.amazon.ca\/Culturenik-182-390-Recreation-Swanson-Pyramid\/dp\/B00UTPTOHG\/ref=sr_1_1?ie=UTF8&qid=1508272877&sr=8-1&keywords=ron+swanson",
      "amount": "43",
      "amount_with_currency": "$43.00",
      "status": "idea",
      "date": null,
      "recipient": null,
      "photos": [],
      "contact": {
        "id": 3,
        "object": "contact",
        "first_name": "Leslie",
        "last_name": "Knope",
        "gender": "none",
        "is_partial": false,
        "information": {
          "dates": [
            {
              "name": "birthdate",
              "is_birthdate_approximate": "unknown",
              "birthdate": null
            }
          ]
        },
        "account": {
          "id": 5
        }
      },
      "account": {
        "id": 5
      },
      "created_at": "2017-10-17T16:41:27Z",
      "updated_at": "2017-10-17T16:41:27Z"
    },
    {
      "id": 3,
      "object": "gift",
      "name": "A giant cup of tea",
      "comment": "",
      "url": "",
      "amount": "21",
      "amount_with_currency": "$21.00",
      "status": "offered",
      "date": null,
      "recipient": {
        "id": 4,
        "object": "contact",
        "first_name": "Ben",
        "last_name": "Wyatt",
        "gender": "male",
        "is_partial": false,
        "information": {
          "dates": [
            {
              "name": "birthdate",
              "is_birthdate_approximate": "approximate",
              "birthdate": "1974-01-01T16:42:11Z"
            }
          ]
        },
        "account": {
          "id": 5
        }
      },
      "photos": [],
      "contact": {
        "id": 3,
        "object": "contact",
        "first_name": "Leslie",
        "last_name": "Knope",
        "gender": "none",
        "is_partial": false,
        "information": {
          "dates": [
            {
              "name": "birthdate",
              "is_birthdate_approximate": "unknown",
              "birthdate": null
            }
          ]
        },
        "account": {
          "id": 5
        }
      },
      "account": {
        "id": 5
      },
      "created_at": "2017-10-17T16:42:25Z",
      "updated_at": "2017-10-17T16:42:25Z"
    }
  ],
  "links": {
    "first": "https:\/\/app.monicahq.com\/api\/gifts?page=1",
    "last": "https:\/\/app.monicahq.com\/api\/gifts?page=1",
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 1,
    "path": "https:\/\/app.monicahq.com\/api\/gifts",
    "per_page": 10,
    "to": 3,
    "total": 3
  }
}

List all the gifts of a specific contact

GET /contacts/:id/gifts

Response

{
  "data": [
    {
      "id": 2,
      "object": "gift",
      "name": "For my friend Ron Swanson",
      "comment": "",
      "url": "https:\/\/www.amazon.ca\/Culturenik-182-390-Recreation-Swanson-Pyramid\/dp\/B00UTPTOHG\/ref=sr_1_1?ie=UTF8&qid=1508272877&sr=8-1&keywords=ron+swanson",
      "amount": "43",
      "amount_with_currency": "$43.00",
      "status": "offered",
      "date": null,
      "recipient": null,
      "photos": [],
      "contact": {
        "id": 3,
        "object": "contact",
        "first_name": "Leslie",
        "last_name": "Knope",
        "gender": "none",
        "is_partial": false,
        "information": {
          "dates": [
            {
              "name": "birthdate",
              "is_birthdate_approximate": "unknown",
              "birthdate": null
            }
          ]
        },
        "account": {
          "id": 5
        }
      },
      "account": {
        "id": 5
      },
      "created_at": "2017-10-17T16:41:27Z",
      "updated_at": "2017-10-17T16:41:27Z"
    },
    {
      "id": 3,
      "object": "gift",
      "name": "A giant cup of tea",
      "comment": "",
      "url": "",
      "amount": "21",
      "amount_with_currency": "$21.00",
      "status": "offered",
      "date": null,
      "recipient": {
        "id": 4,
        "object": "contact",
        "first_name": "Ben",
        "last_name": "Wyatt",
        "gender": "male",
        "is_partial": false,
        "information": {
          "dates": [
            {
              "name": "birthdate",
              "is_birthdate_approximate": "approximate",
              "birthdate": "1974-01-01T16:42:11Z"
            }
          ]
        },
        "account": {
          "id": 5
        }
      },
      "photos": [
        {
          "id": 44,
          "object": "photo",
          "original_filename": "EBeVa4qXsAIMnaC.jpeg",
          "new_filename": "photos\/POWVMVuauZ2xPsG9ZNoZdE0jLaMRz1FGZtCUrjDH.jpeg",
          "filesize": 484289,
          "mime_type": "image\/jpeg",
          "link": "https:\/\/app.monicahq.com\/storage\/photos\/POWVMVuauZ2xPsG9ZNoZdE0jLaMRz1FGZtCUrjDH.jpeg",
          "contact": {
            "id": 3,
            "object": "contact",
            "first_name": "Leslie",
            "last_name": "Knope",
            "gender": "none",
            "is_partial": false,
            "information": {
              "dates": [
                {
                  "name": "birthdate",
                  "is_birthdate_approximate": "unknown",
                  "birthdate": null
                }
              ]
            },
            "account": {
              "id": 5
            }
          },
          "account":{
            "id": 5
          },
          "created_at": "2017-10-17T16:42:25Z",
          "updated_at": "2017-10-17T16:42:25Z",
        }
      ]
      "contact": {
        "id": 3,
        "object": "contact",
        "first_name": "Leslie",
        "last_name": "Knope",
        "gender": "none",
        "is_partial": false,
        "information": {
          "dates": [
            {
              "name": "birthdate",
              "is_birthdate_approximate": "unknown",
              "birthdate": null
            }
          ]
        },
        "account": {
          "id": 5
        }
      },
      "account": {
        "id": 5
      },
      "created_at": "2017-10-17T16:42:25Z",
      "updated_at": "2017-10-17T16:42:25Z"
    }
  ],
  "links": {
    "first": "https:\/\/app.monicahq.com\/api\/contacts\/3\/gifts?page=1",
    "last": "https:\/\/app.monicahq.com\/api\/contacts\/3\/gifts?page=1",
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 1,
    "path": "https:\/\/app.monicahq.com\/api\/contacts\/3\/gifts",
    "per_page": 10,
    "to": 2,
    "total": 2
  }
}

Get a specific gift

GET /gifts/:id

Response

{
  "data": {
    "id": 2,
    "object": "gift",
    "name": "For my friend Ron Swanson",
    "comment": "",
    "url": "https:\/\/www.amazon.ca\/Culturenik-182-390-Recreation-Swanson-Pyramid\/dp\/B00UTPTOHG\/ref=sr_1_1?ie=UTF8&qid=1508272877&sr=8-1&keywords=ron+swanson",
    "amount": "43",
    "amount_with_currency": "$43.00",
    "status": "offered",
    "date": null,
    "recipient": null,
    "photos": [],
    "contact": {
      "id": 3,
      "object": "contact",
      "first_name": "Leslie",
      "last_name": "Knope",
      "gender": "none",
      "is_partial": false,
      "information": {
        "dates": [
          {
            "name": "birthdate",
            "is_birthdate_approximate": "unknown",
            "birthdate": null
          }
        ]
      },
      "account": {
        "id": 5
      }
    },
    "account": {
      "id": 5
    },
    "created_at": "2017-10-17T16:41:27Z",
    "updated_at": "2017-10-17T16:41:27Z"
  }
}

Create a gift

POST /gifts/

Input

Name Type Description
contact_id integer Required. The ID of the contact that the gift is associated with.
recipient_id integer The ID of the contact the gift is for. It is either one of the partner or a child of the contact.
name string Required. The description of the gift. Max 255 characters.
comment string More details about the gift. Max 1000000 characters.
url string The URL where the gift can be find (for instance, on Amazon). Max 1000000 characters.
amount number The amount (in the currency of the user) of the gift.
status string Required. Status of the gift. Could be one of: idea: if the gift is an idea, offered: if the gift has been offered, received: if it's a gift from the contact.
date string The date the gift has been offered. Can be in the past or future - the latter being dumb, but well. Format: YYYY-MM-DD.

Example

{
  "name":"For my friend Ron Swanson",
  "comment":"This is going to be so awesome",
  "url":"https://www.amazon.ca/Culturenik-182-390-Recreation-Swanson-Pyramid/dp/B00UTPTOHG/ref=sr_1_1?ie=UTF8&qid=1508272877&sr=8-1&keywords=ron+swanson",
  "amount":291,
  "status":"offered",
  "date":"2015-02-24",
  "contact_id": 3,
  "recipient_id": 1
}

Response

The API returns a gift object if the gift succeeds.

{
  "data": {
    "id": 676,
    "object": "gift",
    "name": "For my friend Ron Swanson",
    "comment": "This is going to be so awesome",
    "url": "https:\/\/www.amazon.ca\/Culturenik-182-390-Recreation-Swanson-Pyramid\/dp\/B00UTPTOHG\/ref=sr_1_1?ie=UTF8&qid=1508272877&sr=8-1&keywords=ron+swanson",
    "amount": "291",
    "amount_with_currency": "$291.00",
    "status": "offered",
    "date": "2015-02-24T00:00:00Z",
    "recipient": {
      "id": 1,
      "object": "contact",
      "first_name": "Henri",
      "last_name": "Troyat",
      "gender": "male",
      "is_partial": false,
      "information": {
        "dates": [
          {
            "name": "birthdate",
            "is_birthdate_approximate": "unknown",
            "birthdate": null
          }
        ]
      },
      "account": {
        "id": 1
      }
    },
    "photos": [],
    "contact": {
      "id": 3,
      "object": "contact",
      "first_name": "David",
      "last_name": "Olsdwaer",
      "gender": "male",
      "is_partial": false,
      "information": {
        "dates": [
          {
            "name": "birthdate",
            "is_birthdate_approximate": "unknown",
            "birthdate": null
          }
        ]
      },
      "account": {
        "id": 1
      }
    },
    "account": {
      "id": 1
    },
    "created_at": "2017-10-19T21:51:15Z",
    "updated_at": "2017-10-19T21:51:15Z"
  }
}

Update a gift

PUT /gifts/:id

Input

Name Type Description
contact_id integer Required. The ID of the contact that the gift is associated with.
recipient_id integer The ID of the contact the gift is for. It is either one of the partner or a child of the contact.
name string Required. The description of the gift. Max 255 characters.
comment string More details about the gift. Max 1000000 characters.
url string The URL where the gift can be find (for instance, on Amazon). Max 1000000 characters.
amount number The amount (in the currency of the user) of the gift.
status string Required. Status of the gift. Could be one of: idea: if the gift is an idea, offered: if the gift has been offered, received: if it's a gift from the contact.
date string The date the gift has been offered. Can be in the past or future - the latter being dumb, but well. Format: YYYY-MM-DD.

Example

{
  "name":"For my friend Ron Swanson",
  "comment":"This is going to be so awesome",
  "url":"https://www.amazon.ca/Culturenik-182-390-Recreation-Swanson-Pyramid/dp/B00UTPTOHG/ref=sr_1_1?ie=UTF8&qid=1508272877&sr=8-1&keywords=ron+swanson",
  "amount":"293",
  "status":"offered",
  "date":"2015-02-24",
  "contact_id": 3,
  "recipient_id": null
}

Response

{
  "data": {
    "id": 678,
    "object": "gift",
    "name": "For my friend Ron Swanson",
    "comment": "This is going to be so awesome",
    "url": "https:\/\/www.amazon.ca\/Culturenik-182-390-Recreation-Swanson-Pyramid\/dp\/B00UTPTOHG\/ref=sr_1_1?ie=UTF8&qid=1508272877&sr=8-1&keywords=ron+swanson",
    "amount": "293",
    "amount_with_currency": "$293.00",
    "status": "offered",
    "date": "2015-02-24T00:00:00Z",
    "recipient": null,
    "photos": [],
    "contact": {
      "id": 3,
      "object": "contact",
      "first_name": "David",
      "last_name": "Olsdwaer",
      "gender": "male",
      "is_partial": false,
      "information": {
        "dates": [
          {
            "name": "birthdate",
            "is_birthdate_approximate": "unknown",
            "birthdate": null
          }
        ]
      },
      "account": {
        "id": 1
      }
    },
    "account": {
      "id": 1
    },
    "created_at": "2017-10-19T21:52:53Z",
    "updated_at": "2017-10-19T21:52:53Z"
  }
}

Delete a gift

DELETE /gifts/:id

Response

The response sends back the id that was just deleted.

{
  "deleted": true,
  "id": 31
}

Associate a photo to a gift

PUT /gifts/:id/photo/:photoId

A photo can be associated to a gift. You will have to create a photo first, associate with the contact, and then associate it.

Input

No input needed.

Response

{
  "data": {
    "id": 678,
    "object": "gift",
    "name": "For my friend Ron Swanson",
    "comment": "This is going to be so awesome",
    "url": "https:\/\/www.amazon.ca\/Culturenik-182-390-Recreation-Swanson-Pyramid\/dp\/B00UTPTOHG\/ref=sr_1_1?ie=UTF8&qid=1508272877&sr=8-1&keywords=ron+swanson",
    "amount": "293",
    "amount_with_currency": "$293.00",
    "status": "offered",
    "date": "2015-02-24T00:00:00Z",
    "recipient": null,
    "photos": [
      {
        "id": 44,
        "object": "photo",
        "original_filename": "EBeVa4qXsAIMnaC.jpeg",
        "new_filename": "photos\/POWVMVuauZ2xPsG9ZNoZdE0jLaMRz1FGZtCUrjDH.jpeg",
        "filesize": 484289,
        "mime_type": "image\/jpeg",
        "link": "https:\/\/app.monicahq.com\/storage\/photos\/POWVMVuauZ2xPsG9ZNoZdE0jLaMRz1FGZtCUrjDH.jpeg",
        "contact": {
          "id": 3,
          "object": "contact",
          "first_name": "David",
          "last_name": "Olsdwaer",
          "gender": "male",
          "is_partial": false,
          "information": {
            "dates": [
              {
                "name": "birthdate",
                "is_birthdate_approximate": "unknown",
                "birthdate": null
              }
            ]
          },
          "account":{
            "id": 1
          },
        },
        "account":{
          "id": 1
        },
        "created_at": "2017-10-17T16:42:25Z",
        "updated_at": "2017-10-17T16:42:25Z",
      }
    ],
    "contact": {
      "id": 3,
      "object": "contact",
      "first_name": "David",
      "last_name": "Olsdwaer",
      "gender": "male",
      "is_partial": false,
      "information": {
        "dates": [
          {
            "name": "birthdate",
            "is_birthdate_approximate": "unknown",
            "birthdate": null
          }
        ]
      },
      "account": {
        "id": 1
      }
    },
    "account": {
      "id": 1
    },
    "created_at": "2017-10-19T21:52:53Z",
    "updated_at": "2017-10-19T21:52:53Z"
  }
}

Company

© 2018 — 2024

Proudly Canadian