API documentation
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.
GET /gifts/
Name | Type | Description |
---|---|---|
limit | integer | Indicates the page size. |
page | integer | Indicates the page to return. |
{
"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
}
}
GET /contacts/:id/gifts
{
"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 /gifts/:id
{
"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"
}
}
POST /gifts/
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. |
{
"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
}
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"
}
}
PUT /gifts/:id
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. |
{
"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
}
{
"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 /gifts/:id
The response sends back the id that was just deleted.
{
"deleted": true,
"id": 31
}
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.
No input needed.
{
"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"
}
}
Features
Company
Resources
© 2018 — 2024