Endpoint "Get analytics" returning empty response - microsoft-graph-api

GET /drives/{drive-id}/items/{item-id}/analytics
refrence: https://learn.microsoft.com/en-us/graph/api/itemanalytics-get?view=graph-rest-beta
On trying to call this endpoint, it is returning empty as response with 200 status code.
As per documentation, it should have return something like
{
"allTime": {
"access": {
"actionCount": 123,
"actorCount": 89
}
},
"lastSevenDays": {
"access": {
"actionCount": 52,
"actorCount": 41
}
}
}
request-id: 67aa7bd8-6bd3-40c0-8f12-a1c4cabda4af

Try adding /lastSevenDays or /AllTime to it and it should return the data.
GET /drives/{drive-id}/items/{item-id}/analytics/lastSevenDays
GET /drives/{drive-id}/items/{item-id}/analytics/allTime

This is still an issue and now that endpoint is under the 1.0 ref (not beta any more)

Related

Google Slides API reports Invalid requests[0].updateTableCellProperties: Invalid field: table_cell_properties

Trying to troubleshoot an error message my app gets after sending a batchUpdate request to Google Slides API
Invalid requests[19].updateTableCellProperties: Invalid field: table_cell_properties
The 19th request in the batch is the only updateTableCellProperties request I have. If I removing the 19th request from the batch, everything works fine.
Other requests which I run in this batchUpdate with no issues are are insertTableRows, deleteTableRow, insertText, updateParagraphStyle, updateTextStyle, updateTableColumnProperties. They all work on the same table, so I use the same objectId, but depending on the request I have to specify it as tableObjectId instead of objectId.
Unsure if I am generating a wrong request for the only updateTableCellProperties request I have, or if there is a problem in the Google Slides ruby gem itself, I tried sending just this updateTableCellProperties request from the Google Slides API explorer which has some validation on the request structure. So I sent this updateTableCellProperties batchUpdate request
{
"requests": [
{
"updateTableCellProperties": {
"objectId": "gf9d8fea71f_22_1",
"tableRange": {
"location": {
"columnIndex": 0,
"rowIndex": 1
}
},
"fields": "tableCellProperties",
"tableCellProperties": {
"tableCellBackgroundFill": {
"solidFill": {
"color": {
"themeColor": "LIGHT1"
}
}
}
}
}
}
]
}
And I got this error:
{
"error": {
"code": 400,
"message": "Invalid requests[0].updateTableCellProperties: Invalid field: table_cell_properties",
"status": "INVALID_ARGUMENT"
}
}
Why is this updateTableCellProperties request reported as invalid? I am also confused by the output of the error message as it mentions table_cell_properties in snake case, while the documentation only mentions tableCellProperties in camel case, and my request also only mentions tableCellProperties in camel case. I am only aware of the ruby gems translating between snake case and camel case, but this is not relevant to the API Explorer.
The error Invalid field: table_cell_properties originates from the erroneously specified fields property
See documentation:
fields
At least one field must be specified. The root tableCellProperties is implied and should not be specified. A single "*" can be used as short-hand for listing every field.
So you need to modify fields
from
"fields": "tableCellProperties"
to
"fields": "tableCellBackgroundFill.solidFill.color"
or to
"fields": "*"
There is a second problem with your request:
When specifying the table range, it is required to set the properties rowSpan and columnSpan.
A complete, correct request would be:
{
"requests": [
{
"updateTableCellProperties": {
"objectId": "gf9d8fea71f_22_1",
"tableRange": {
"location": {
"columnIndex": 0,
"rowIndex": 1
},
"rowSpan": 1,
"columnSpan": 1
},
"fields": "tableCellBackgroundFill.solidFill.color",
"tableCellProperties": {
"tableCellBackgroundFill": {
"solidFill": {
"color": {
"themeColor": "LIGHT1"
}
}
}
}
}
}
]
}

Google Sheets API V4 - Autofill Error - No grid with id: 0

I am trying to make an AutoFillRequest using a SourceAndDestination object to describe the area to autofill. I've tested autofill requests using a GridRange object and everything works fine, but can't seem to get the SourceAndDestination working. Here is an example where I'm trying to autofill down the first row for 2 more rows.
HTTP POST
https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}:batchUpdate
Request Body
{
"requests": [
{
"autoFill": {
"sourceAndDestination": {
"dimension": "ROWS",
"fillLength": 2,
"source": {
"sheetId": 1150108545,
"endRowIndex": 1,
"startRowIndex": 0
}
},
"useAlternateSeries": false
}
}
]
}
The response has an error code 400:
message = "Invalid requests[0].autoFill: No grid with id: 0" status =
"INVALID_ARGUMENT"
Sorry about that, this was a bug on the server. It's now fixed, so the above should work.

AWS API Gateway exported IOS SDK no error response

I am using the exported API Gateway IOS SDK. The API was originally imported to the API Gateway via Swagger as a template, but since modified with the AWS portal to map back to the response model and class within the IOS SDK. All 200 requests are returned with no issue. I am using pod 'AWSAPIGateway', '= 2.4.1'
The issue i am having is nothing else other then 200 response is handled and/or received by the IOS SDK. I know it is sent because Cloudwatch shows the correct mapping, but nothing is returned in the IOS App.
At first i thought maybe i was conflicting with the API Gateway's own response codes so i switched to 403 which wasn't on it list. But that didn't work. I am also not getting 500 response errors.
Here is the calling function:
client.apiRequestPut(apiRequestVar).continueWithSuccessBlock {
(task: AWSTask!) -> AnyObject! in
print(task)
if ((task.error) != nil) {
print(task.error)
return nil;
}
if( (task.result != nil)) {
print(task.result)
}
}
return nil
}
And the AWS SDK Generated Client Function:
- (AWSTask *)apiRequestPut:(APINewRequest *)body {
NSDictionary *headerParameters = #{
#"Content-Type": #"application/json",
#"Accept": #"application/json",
};
NSDictionary *queryParameters = #{
};
NSDictionary *pathParameters = #{
};
return [self invokeHTTPRequest:#"PUT"
URLString:#"/requestVariable"
pathParameters:pathParameters
queryParameters:queryParameters
headerParameters:headerParameters
body:body
responseClass:[APIModel class]];
}
}
Here is the Error Model:
#implementation APIErrorModel
+ (NSDictionary *)JSONKeyPathsByPropertyKey {
return #{
#"success": #"success",
#"theFunction": #"theFunction",
#"action": #"action",
#"timeStamp": #"timeStamp",
#"error": #"error",
#"data": #"data"
};
}
+ (NSValueTransformer *)timeStampJSONTransformer {
return [AWSMTLValueTransformer reversibleTransformerWithForwardBlock:^id(NSString *dateString) {
return [NSDate aws_dateFromString:dateString format:AWSDateISO8601DateFormat1];
} reverseBlock:^id(NSDate *date) {
return [date aws_stringValue:AWSDateISO8601DateFormat1];
}];
}
Here is the mapping in the API Gateway for 400 response code:
#set($inputRoot = $input.path('$'))
{
"success" : $input.json('$.success'),
"theFunction" : "foo",
"action" : "foo",
"timeStamp" : "foo",
"error" : "foo",
"data" : $input.json('$.message')
}
Here is the resulting Cloudwatch log entry:
Endpoint response body before transformations:
{
"success": false,
"message": "{\"message\":\"The conditional request failed\",\"code\":\"ConditionalCheckFailedException\",\"time\":\"2016-05- 12T20:16:03.165Z\",\"statusCode\":400,\"retryable\":false,\"retryDelay\":0} "
}
Endpoint response headers: {content-length=217, Connection=keep-alive, content-type=application/json; charset=utf-8, cache-control=no-cache, Date=Thu, 12 May 2016 20:16:03 GMT
}
Method response body after transformations:
{
"success": false,
"theFunction": "foo",
"action": "foo",
"timeStamp": "foo",
"error": "foo",
"data": "{\"message\":\"The conditional request failed\",\"code\":\"ConditionalCheckFailedException\",\"time\":\"2016-05- 12T20:16:03.165Z\",\"statusCode\":400,\"retryable\":false,\"retryDelay\":0} "
}
Method response headers: {Content-Type=application/json}
Successfully completed execution
Method completed with status: 400
But then i get nothing received back in the iOS app?
Any help to what i am missing would be much appreciated!
- continueWithSuccessBlock: is used when you want to extract only the result from the task object. The task object in - continueWithSuccessBlock: always has the nil error property. If you want to receive errors, you need to use - continueWithBlock: instead.
See the Bolts documentation for more details.

What am I doing wrong in this QBO v3 Reports API query?

When I use the following query, I get a good response (with only the first 5 days of May, so apparently the default is not 'This Fiscal Year-to-date' as the documentation suggests, but I digress):
https://quickbooks.api.intuit.com/v3/company/0123456789/reports/CustomerSales
When I add parameters, I get an oauth exception. For example:
https://quickbooks.api.intuit.com/v3/company/0123456789/reports/CustomerSales?start_date='2013-01-01'&end_date='2014-05-06'
Gives me this:
{
"Fault": {
"type": "AUTHENTICATION",
"Error": [
{
"Message": "message=Exception authenticating OAuth; errorCode=003200; statusCode=401",
"code": "3200"
}
]
},
"requestId": "[redacted]",
"time": "[redacted]"
}
This gives me the same result:
https://quickbooks.api.intuit.com/v3/company/0123456789/reports/CustomerSales?date_macro='This Fiscal Year'
So does this:
https://quickbooks.api.intuit.com/v3/company/148305798/reports/CustomerSales?accounting_method='Accrual'
I figure I'm missing something small. I'm not changing any of the headers or any of the other request details...just the url.
I tried without the single quotes around the dates and other params too.
What am I breaking?
Are you including the data to the right of the ? in the URL in the "base" string and are you sorting it with the other parameters?
I've tried this report using java devkit.
It worked fine for me. PFB details.
Request URI - https://quickbooks.api.intuit.com/v3/company/1092175540/reports/CustomerSales?accounting_method=Accrual&start_date=2014-01-01&requestid=61234ddb7e14ce2a5fe4e2f0318b31c&minorversion=1&
My test company file is empty.. That's why got the following JSON response.
{
"Header":{
"Time":"2014-05-06T20:42:08.783-07:00",
"ReportName":"CustomerSales",
"ReportBasis":"Accrual",
"StartPeriod":"2014-05-01",
"EndPeriod":"2014-05-06",
"SummarizeColumnsBy":"Total",
"Currency":"USD"
},
"Columns":{
"Column":[
{
"ColTitle":"",
"ColType":"Customer"
}
]
},
"Rows":{
"Row":[
{
"ColData":[
{
"value":"TOTAL"
}
],
"group":"GrandTotal"
}
]
}
}
JAVA code
void testCustomerSalesReport(Context context) {
Config.setProperty(Config.SERIALIZATION_RESPONSE_FORMAT, "json");
ReportService service = new ReportService(context);
service.setStart_date("2014-01-01");
service.setAccounting_method("Accrual");
Report report = null;
try {
report = service.executeReport(ReportName.CUSTOMERSALES.toString());
} catch (FMSException e) {
e.printStackTrace();
}
}
API Doc Ref - https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/reports/customersales
Hope it will be useful.
Thanks

Google+ api moments insert unauthorized message

I'm trying to insert moments, using access_token, that i generated here https://developers.google.com/oauthplayground/ and receive "Unauthorized" message. What i do wrong?
My request is:
{
"target": {
"url": "http://example.com"
},
"type": "http://schemas.google.com/AddActivity"
}
I send this data on
www.googleapis.com/plus/v1/people/me/moments/vault?access_token=######, where ###### - my access token.
The response is:
{
"error":{
"errors":[
{
"domain":"global",
"reason":"unauthorized",
"message":"Unauthorized"
}
],
"code":401,
"message":"Unauthorized"
}
}
i had the same problem, i solved it by adding "request_visible_actions" and also make sure you have the login scope set on your request i.e "https://www.googleapis.com/auth/plus.login"

Resources