<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 async def update_intervals_data(self):
 """Update intervals data json for specified time period."""

        url = '{}/users/{}/intervals'.format(API_URL, self.userid)

        intervals = await self.device.api_get(url)
        if intervals is None:
            _LOGGER.error('Unable to fetch eight intervals data.')
        else:
            self.intervals = intervals['intervals']