Google Health API มีประเภทข้อมูลสำหรับการติดตามอนามัยการเจริญพันธุ์ อาการ และอารมณ์ ประเภทข้อมูลเหล่านี้ช่วยให้คุณบันทึกประจำเดือน ผลการทดสอบการตกไข่ รวมถึงสภาวะทางร่างกายและอารมณ์ที่เกี่ยวข้องได้
ประเภทข้อมูลที่รองรับ
| ประเภทข้อมูล | การดำเนินการที่ใช้ได้ |
ขอบเขต |
|---|---|---|
|
ประจำเดือน
dataType:
menstrual-periodfilter parameter: menstrual_period
ประเภทระเบียน: ช่วงเวลา
|
สร้าง อัปเดต batchDelete | .reproductive_health.writeonly |
|
อารมณ์
|
สร้าง อัปเดต batchDelete | .mindfulness.writeonly |
|
การทดสอบการตกไข่
dataType:
ovulation-testfilter parameter: ovulation_test
ประเภทระเบียน: ตัวอย่าง
|
สร้าง อัปเดต batchDelete | .reproductive_health.writeonly |
|
อาการ
|
สร้าง อัปเดต batchDelete | .logged_symptoms.writeonly |
ประจำเดือน
ประจำเดือนแสดงถึงช่วงเวลาที่ผู้ใช้บันทึกไว้ ดูรายการฟิลด์และคำอธิบายทั้งหมดได้ที่
MenstrualPeriod
หลักเกณฑ์สำหรับการบันทึกประจำเดือน
- ต้องระบุวันที่สิ้นสุด: ระเบียนประจำเดือนทั้งหมดต้องมีวันที่หรือเวลาสิ้นสุด วันที่สิ้นสุดไม่ควรเป็นค่าว่าง
- การจัดการประจำเดือนที่ยังไม่สิ้นสุด: หากคุณระบุวันที่สิ้นสุดไม่ได้เมื่อ สร้างระเบียน (เช่น ประจำเดือนยังไม่สิ้นสุด) ให้ตั้งวันที่สิ้นสุดให้ตรงกับวันที่เริ่มต้น อัปเดตระเบียนทุกวันโดยตั้งวันที่สิ้นสุดเป็นวันที่ปัจจุบันจนกว่าประจำเดือนจะสิ้นสุดและยืนยันวันที่สิ้นสุดได้
- ประจำเดือนที่ยืนยันแล้ว: ระบบจะถือว่าระเบียนประจำเดือนทั้งหมดเป็นประจำเดือนที่ยืนยันแล้ว
สร้างประจำเดือน
หากต้องการสร้างรายการประจำเดือน ให้ส่งคำขอ POST ไปยังปลายทางจุดข้อมูล menstrual-period การตอบกลับจะมีฟิลด์ name
ที่มี data-point-id ซึ่งใช้ใน
คำขอการลบแบบกลุ่ม หรือ
อัปเดต (Patch) ได้
ส่งคำขอ
POST https://health.googleapis.com/v4/users/me/dataTypes/menstrual-period/dataPoints
Authorization: Bearer access-token
Content-Type: application/json
{
"menstrualPeriod": {
"interval": {
"startTime": "2026-07-01T08:00:00Z",
"endTime": "2026-07-05T20:00:00Z"
},
"notes": "Regular flow reported."
}
}คำตอบ
{
"done": true,
"response": {
"@type": "type.googleapis.com/google.devicesandservices.health.v4.DataPoint",
"name": "users/user-id/dataTypes/menstrual-period/dataPoints/data-point-id",
"menstrualPeriod": {
"interval": {
"startTime": "2026-07-01T08:00:00Z",
"startUtcOffset": "0s",
"endTime": "2026-07-05T20:00:00Z",
"endUtcOffset": "0s",
"civilStartTime": {
"date": { "year": 2026, "month": 7, "day": 1 },
"time": { "hours": 8 }
},
"civilEndTime": {
"date": { "year": 2026, "month": 7, "day": 5 },
"time": { "hours": 20 }
}
},
"notes": "Regular flow reported."
}
}
}การทดสอบการตกไข่
บันทึกข้อมูลการทดสอบการตกไข่ ดูรายการฟิลด์และ
คำอธิบายทั้งหมดได้ที่
OvulationTest
สร้างการทดสอบการตกไข่
หากต้องการบันทึกผลการทดสอบการตกไข่ ให้ส่งคำขอ POST ไปยังปลายทางจุดข้อมูล ovulation-test การตอบกลับจะมีฟิลด์ name ที่มี
data-point-id ซึ่งใช้ในคำขอการลบแบบกลุ่ม หรือ
การอัปเดต (Patch) ได้
ส่งคำขอ
POST https://health.googleapis.com/v4/users/me/dataTypes/ovulation-test/dataPoints
Authorization: Bearer access-token
Content-Type: application/json
{
"ovulationTest": {
"sampleTime": {
"physicalTime": "2026-07-14T07:30:00Z"
},
"result": "LUTEINIZING_HORMONE_SURGE"
}
}คำตอบ
{
"done": true,
"response": {
"@type": "type.googleapis.com/google.devicesandservices.health.v4.DataPoint",
"name": "users/user-id/dataTypes/ovulation-test/dataPoints/data-point-id",
"ovulationTest": {
"sampleTime": {
"physicalTime": "2026-07-14T07:30:00Z",
"utcOffset": "0s",
"civilTime": {
"date": { "year": 2026, "month": 7, "day": 14 },
"time": { "hours": 7, "minutes": 30 }
}
},
"result": "LUTEINIZING_HORMONE_SURGE"
}
}
}อาการ
บันทึกอาการทางร่างกายที่เกิดขึ้น ณ การประทับเวลาที่ระบุ ดูรายการฟิลด์และคำอธิบายทั้งหมดได้ที่
Symptoms
สร้างบันทึกอาการ
หากต้องการบันทึกอาการทางร่างกาย ให้ส่งคำขอ POST ไปยังปลายทางจุดข้อมูล symptoms การตอบกลับจะมีฟิลด์ name ที่มี data-point-id,
ซึ่งใช้ในคำขอการลบแบบกลุ่ม หรือ
การอัปเดต (Patch) ได้
ส่งคำขอ
POST https://health.googleapis.com/v4/users/me/dataTypes/symptoms/dataPoints
Authorization: Bearer access-token
Content-Type: application/json
{
"symptoms": {
"sampleTime": {
"physicalTime": "2026-07-02T19:00:00Z"
},
"symptoms": [ "CRAMPS", "BLOATED", "FATIGUE" ]
}
}คำตอบ
{
"done": true,
"response": {
"@type": "type.googleapis.com/google.devicesandservices.health.v4.DataPoint",
"name": "users/user-id/dataTypes/symptoms/dataPoints/data-point-id",
"symptoms": {
"sampleTime": {
"physicalTime": "2026-07-02T19:00:00Z",
"utcOffset": "0s",
"civilTime": {
"date": { "year": 2026, "month": 7, "day": 2 },
"time": { "hours": 19 }
}
},
"symptoms": [ "CRAMPS", "BLOATED", "FATIGUE" ]
}
}
}อารมณ์
บันทึกสภาวะทางอารมณ์และอารมณ์ ณ การประทับเวลาที่ระบุ ดูรายการฟิลด์และคำอธิบายทั้งหมดได้ที่
Moods
สร้างบันทึกอารมณ์
หากต้องการบันทึกสภาวะทางอารมณ์ ให้ส่งคำขอ POST ไปยังปลายทางจุดข้อมูล moods การตอบกลับจะมีฟิลด์ name ที่มี data-point-id,
ซึ่งใช้ในคำขอการลบแบบกลุ่ม หรือ
การอัปเดต (Patch) ได้
ส่งคำขอ
POST https://health.googleapis.com/v4/users/me/dataTypes/moods/dataPoints
Authorization: Bearer access-token
Content-Type: application/json
{
"moods": {
"sampleTime": {
"physicalTime": "2026-07-02T21:00:00Z"
},
"moods": [ "CALM", "CONTENT" ],
"valences": [ "PLEASANT" ]
}
}คำตอบ
{
"done": true,
"response": {
"@type": "type.googleapis.com/google.devicesandservices.health.v4.DataPoint",
"name": "users/user-id/dataTypes/moods/dataPoints/data-point-id",
"moods": {
"sampleTime": {
"physicalTime": "2026-07-02T21:00:00Z",
"utcOffset": "0s",
"civilTime": {
"date": { "year": 2026, "month": 7, "day": 2 },
"time": { "hours": 21 }
}
},
"moods": [ "CALM", "CONTENT" ],
"valences": [ "PLEASANT" ]
}
}
}การลบแบบกลุ่ม
หากต้องการลบจุดข้อมูลอย่างน้อย 1 จุด ให้ส่งคำขอ POST ไปยังปลายทาง batchDelete พร้อมชื่อทรัพยากรของรายการที่จะนำออก
POST https://health.googleapis.com/v4/users/me/dataTypes/data-type-name/dataPoints:batchDelete
Authorization: Bearer access-token
Content-Type: application/json
{
"names": [
"users/me/dataTypes/data-type/dataPoints/data-point-id"
]
}ตัวอย่าง: การลบจุดข้อมูลหลายจุด
หากต้องการลบจุดข้อมูลหลายจุดในคำขอเดียว ให้ใส่ชื่อทรัพยากรของจุดข้อมูลเหล่านั้นในอาร์เรย์ names
POST https://health.googleapis.com/v4/users/me/dataTypes/symptoms/dataPoints:batchDelete
Authorization: Bearer access-token
Content-Type: application/json
{
"names": [
"users/user-id/dataTypes/symptoms/dataPoints/symptom-id-1",
"users/user-id/dataTypes/symptoms/dataPoints/symptom-id-2"
]
}