However, if you meant sorting (ORDER BY clause) the report data by AdGroupId, then unfortunately, it is not supported in AdWords API reports as discussed
here. That said, there is no way to do a report query and return the data ordered by the specified field (e.g. adGroupId). However, you can sort them manually once you have the report downloaded file.
Please confirm.