kalnyc67 / analytics-issues

Automatically exported from code.google.com/p/analytics-issues
0 stars 0 forks source link

API analytics.management.uploads.uploadData Analytics API service error 500 when upload data #525

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Get latest PHP client library from 
https://github.com/google/google-api-php-client
2. Try code example from page 
https://developers.google.com/analytics/devguides/config/mgmt/v3/mgmtReference/m
anagement/uploads/uploadData with real data
3. Get 
There was an Analytics API service error 500:Error calling POST 
https://www.googleapis.com/upload/analytics/v3/management/accounts/468424/webpro
perties/UA-468424-1/customDataSources/Tn7pxbV7Siqfn9XFaAsmBQ/uploads?uploadType=
media: (500) There was an internal error.

files to test service.php is attached 
If you need key file for authorization I could send

Original issue reported on code.google.com by maxindah...@gmail.com on 30 Oct 2014 at 12:27

Attachments:

GoogleCodeExporter commented 9 years ago
found why?

Original comment by tser...@gmail.com on 18 Nov 2014 at 9:59

GoogleCodeExporter commented 9 years ago
I see by your example code that you attempt to simply upload a string.
      array('data' => "ga:dimension1,ga:dimension8\n\rwork,100",
            'mimeType' => 'application/octet-stream',
            'uploadType' => 'media'));
Have you attempted to upload a file similar to the example you referenced.
      array('data' => file_get_contents('example.csv'),
            'mimeType' => 'application/octet-stream',
            'uploadType' => 'media'));
Please test with an actual file and let me know if this problem persists.

Original comment by mcoh...@google.com on 18 Nov 2014 at 4:58

GoogleCodeExporter commented 9 years ago
In fact, the content of a file is sent, not the file itself.
array('data' => file_get_contents('example.csv'),

But now i have another error with the same code:

There was an Analytics API service error 403:Error calling POST 
https://www.googleapis.com/upload/analytics/v3/management/accounts/468424/webpro
perties/UA-468424-1/customDataSources/Tn7pxbV7Siqfn9XFaAsmBQ/uploads?uploadType=
media: (403) Insufficient permissions

Original comment by maxindah...@gmail.com on 20 Nov 2014 at 1:00

GoogleCodeExporter commented 9 years ago
The issue tracker is to report bugs and feature requests not for general 
support. For questions related to Analytics APIs use the forums. 
https://developers.google.com/analytics/help/

and in this case specifically, review the documentation on Errors:
https://developers.google.com/analytics/devguides/config/mgmt/v3/errors

Original comment by pfrise...@google.com on 20 Nov 2014 at 4:39