Google 피트니스 REST API를 비롯한 Google 피트니스 API는 2026년에 지원 중단될 예정입니다. 2024년 5월 1일부터 개발자는 이러한 API를 사용하도록 가입할 수 없습니다.
이전할 API 또는 플랫폼에 관한 안내는 헬스 커넥트 이전 가이드를 참고하세요. 헬스 커넥트와 Google Fit API 및 Fitbit Web API를 비교하려면 헬스 커넥트 비교 가이드를 참고하세요.
헬스 커넥트 및 API와 통합하는 방법을 자세히 알아보세요.
Users.dataSources.datasets: patch
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
데이터 세트에 데이터 포인트를 추가합니다. 데이터 세트를 이전에 만들 필요가 없습니다.
지정된 데이터 세트 내의 모든 포인트가 후속 호출과 함께 반환됩니다.
이 데이터 세트를 가져옵니다. 데이터 포인트는 둘 이상의 데이터 세트에 속할 수 있습니다.
이 방법은 패치 시맨틱스를 사용하지 않습니다. 제공된 데이터 포인트는
기존 데이터는 대체되지 않고 단순히 삽입될 뿐입니다.
지금 사용해 보세요.
요청
HTTP 요청
PATCH https://www.googleapis.com/fitness/v1/users/userId/dataSources/dataSourceId/datasets/datasetId
매개변수
매개변수 이름 |
값 |
설명 |
경로 매개변수 |
dataSourceId |
string |
데이터 세트를 만든 데이터 소스의 데이터 스트림 ID입니다.
|
datasetId |
string |
이 필드는 사용되지 않으며 생략해도 됩니다.
|
userId |
string |
식별된 사람의 데이터 세트에 패치를 적용합니다. me 를 사용하여 표시
확인할 수 있습니다 현재는 me 만 지원됩니다.
|
승인
이 요청을 처리하려면 다음 범위 중 하나 이상의 승인이 필요합니다.
범위 |
https://www.googleapis.com/auth/fitness.activity.write |
https://www.googleapis.com/auth/fitness.location.write |
https://www.googleapis.com/auth/fitness.body.write |
https://www.googleapis.com/auth/fitness.nutrition.write |
https://www.googleapis.com/auth/fitness.blood_pressure.write |
https://www.googleapis.com/auth/fitness.blood_glucose.write |
https://www.googleapis.com/auth/fitness.oxygen_saturation.write |
https://www.googleapis.com/auth/fitness.body_temperature.write |
https://www.googleapis.com/auth/fitness.reproductive_health.write |
자세한 내용은 인증 및 승인 페이지를 참조하세요.
요청 본문
요청 본문에 패치 의미 체계 규칙에 따라 Users.dataSources.datasets 리소스의 관련 부분에 다음 속성을 제공합니다.
속성 이름 |
값 |
설명 |
참고 |
필수 속성 |
dataSourceId |
string |
이 데이터 세트의 점을 만든 데이터 소스의 데이터 스트림 ID입니다. |
|
maxEndTimeNs |
long |
데이터 세트의 부분적 표현일 수 있는 모든 데이터 포인트의 최대 종료 시간입니다. 시간은 에포크로부터 나노초 단위입니다. 데이터 세트 식별자의 두 번째 부분과도 일치해야 합니다. |
|
minStartTimeNs |
long |
데이터 세트의 부분적 표현에 있는 모든 데이터 포인트의 최소 시작 시간입니다. 시간은 에포크로부터 나노초 단위입니다. 데이터 세트 식별자의 첫 번째 부분과도 일치해야 합니다. |
|
point[] |
list |
데이터세트에 포함된 데이터 포인트의 일부 목록으로, endTimeNanos 순으로 정렬됩니다. 이 목록은 작은 데이터세트를 검색하는 경우 완전한 것으로, 데이터세트를 패치하거나 너무 큰 데이터세트를 단일 응답에 포함할 수 없는 경우에는 일부만 가져오는 것으로 간주됩니다. |
|
point[].dataTypeName |
string |
이 데이터 포인트의 값 형식을 정의하는 데이터 유형입니다. |
|
point[].endTimeNanos |
long |
이 데이터 포인트가 나타내는 간격의 종료 시간(에포크 이후 나노초)입니다. |
|
point[].startTimeNanos |
long |
이 데이터 포인트가 나타내는 간격의 시작 시간(에포크 이후 나노초)입니다. |
|
point[].value[] |
list |
데이터 포인트의 각 데이터 유형 필드 값입니다. 데이터 유형 필드에 해당하는 각 값은 필드가 데이터 소스에 지정된 데이터 유형에 나열되는 순서와 동일한 순서로 나타나야 합니다.
데이터 소스의 유형 필드 내 형식 enum 값에 따라 정수 및 부동 소수점 필드 중 하나만 채워집니다.
|
|
사용해 보기
아래의 API 탐색기를 사용하여 실시간 데이터를 대상으로 이 메소드를 호출하고 응답을 확인해 보세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-25(UTC)
[null,null,["최종 업데이트: 2025-07-25(UTC)"],[[["\u003cp\u003eAdds data points to a new or existing dataset within Google Fit, returning all dataset points upon retrieval.\u003c/p\u003e\n"],["\u003cp\u003eUtilizes an insert-only approach, without replacing pre-existing data.\u003c/p\u003e\n"],["\u003cp\u003eRequires authorization with specific scopes, such as \u003ccode\u003ehttps://www.googleapis.com/auth/fitness.activity.write\u003c/code\u003e, for data access.\u003c/p\u003e\n"],["\u003cp\u003eThe request body necessitates properties like \u003ccode\u003edataSourceId\u003c/code\u003e, \u003ccode\u003emaxEndTimeNs\u003c/code\u003e, \u003ccode\u003eminStartTimeNs\u003c/code\u003e, and an array of data points (\u003ccode\u003epoint[]\u003c/code\u003e) with corresponding values.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful requests return a \u003ccode\u003eUsers.dataSources.datasets\u003c/code\u003e resource containing the updated dataset information.\u003c/p\u003e\n"]]],[],null,["# Users.dataSources.datasets: patch\n\n| **Note:** Requires [authorization](#auth).\n\nAdds data points to a dataset. The dataset need not be previously created.\nAll points within the given dataset will be returned with subsquent calls\nto retrieve this dataset. Data points can belong to more than one dataset.\n\n\u003cbr /\u003e\n\n\nThis method does not use patch semantics: the data points provided are\nmerely inserted, with no existing data replaced.\n[Try it now](#try-it).\n\nRequest\n-------\n\n### HTTP request\n\n```\nPATCH https://www.googleapis.com/fitness/v1/users/userId/dataSources/dataSourceId/datasets/datasetId\n```\n\n### Parameters\n\n| Parameter name | Value | Description |\n|----------------|----------|------------------------------------------------------------------------------------------------------------------------------|\n| **Path parameters** |||\n| `dataSourceId` | `string` | The data stream ID of the data source that created the dataset. |\n| `datasetId` | `string` | This field is not used, and can be safely omitted. |\n| `userId` | `string` | Patch a dataset for the person identified. Use `me` to indicate the authenticated user. Only `me` is supported at this time. |\n\n### Authorization\n\nThis request requires authorization with at least one of the following scopes:\n\n| Scope |\n|---------------------------------------------------------------------|\n| `https://www.googleapis.com/auth/fitness.activity.write` |\n| `https://www.googleapis.com/auth/fitness.location.write` |\n| `https://www.googleapis.com/auth/fitness.body.write` |\n| `https://www.googleapis.com/auth/fitness.nutrition.write` |\n| `https://www.googleapis.com/auth/fitness.blood_pressure.write` |\n| `https://www.googleapis.com/auth/fitness.blood_glucose.write` |\n| `https://www.googleapis.com/auth/fitness.oxygen_saturation.write` |\n| `https://www.googleapis.com/auth/fitness.body_temperature.write` |\n| `https://www.googleapis.com/auth/fitness.reproductive_health.write` |\n\nFor more information, see the [authentication and authorization](/fit/rest/v1/authorization) page.\n\n### Request body\n\nIn the request body, supply the relevant portions of a [Users.dataSources.datasets resource](/fit/rest/v1/reference/users/dataSources/datasets#resource), according to the rules of patch semantics, with the following properties:\n\n| Property name | Value | Description | Notes |\n|--------------------------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------|\n| **Required Properties** ||||\n| `dataSourceId` | `string` | The data stream ID of the data source that created the points in this dataset. | |\n| `maxEndTimeNs` | `long` | The largest end time of all data points in this possibly partial representation of the dataset. Time is in nanoseconds from epoch. This should also match the second part of the dataset identifier. | |\n| `minStartTimeNs` | `long` | The smallest start time of all data points in this possibly partial representation of the dataset. Time is in nanoseconds from epoch. This should also match the first part of the dataset identifier. | |\n| `point[]` | `list` | A partial list of data points contained in the dataset, ordered by endTimeNanos. This list is considered complete when retrieving a small dataset and partial when patching a dataset or retrieving a dataset that is too large to include in a single response. | |\n| point[].`dataTypeName` | `string` | The data type defining the format of the values in this data point. | |\n| point[].`endTimeNanos` | `long` | The end time of the interval represented by this data point, in nanoseconds since epoch. | |\n| point[].`startTimeNanos` | `long` | The start time of the interval represented by this data point, in nanoseconds since epoch. | |\n| point[].`value[]` | `list` | Values of each data type field for the data point. It is expected that each value corresponding to a data type field will occur in the same order that the field is listed with in the data type specified in a data source. Only one of integer and floating point fields will be populated, depending on the format enum value within data source's type field. | |\n\nResponse\n--------\n\nIf successful, this method returns a [Users.dataSources.datasets resource](/fit/rest/v1/reference/users/dataSources/datasets#resource) in the response body.\n\nTry it!\n-------\n\n\nUse the APIs Explorer below to call this method on live data and see the response."]]