What's meaning "StaffMember ID is missing"?

Solved
Highlighted
Tourist
10 0 1

I have an app using Analytics API to fetch data. It used to run well. But today I got a response "StaffMember ID is missing", I can't find information about this error. And I didn't change anything in the script. 

1 Like
Highlighted
Shopify Staff
Shopify Staff
1040 139 165

Hey @CharlieZ 

 

Can you please provide the request ID from the response headers?

0 Likes
Highlighted
Tourist
10 0 1

I am using the Embedded App SDK. When I use ShopifyApp.Analytics.fetch then response error with that message. But it works today. I have no idea.

0 Likes
Highlighted
Tourist
10 0 1
Hi Scott,

The same error is showed up again today, Can you help to check it out?
0 Likes
Highlighted
Tourist
10 0 1

@scottydontIt seems that the problem has happened again, can you help find out the reason?


@scottydont wrote:

Hey @CharlieZ 

 

Can you please provide the request ID from the response headers?


 

0 Likes
Highlighted
Tourist
10 0 1

@scottydont 

Here is my code, response "Staffmember ID is missing", and it works yesterday with the same script.

 

function shopify_query(tttt,t){
//alert(ShopifyApp.User.current.accountAccess);
var d1=$("#Sdate1").val();
var d2=$("#Sdate2").val();
var tt=$("#Stime").val();
$("#loading").show();
$("#Sbtn_sub").val("查询中...");
$("#Sbtn_sub").prop("disabled",true);
 
    //var shopifyQL = 'SHOW total_visitors,total_sessions,total_pageviews BY day FROM visits SINCE -2w UNTIL today ORDER BY day';
    switch(tttt){
case 0:var shopifyQL = 'SHOW orders,gross_sales,discounts,shipping,net_sales,refunds,returned_item_quantity,net_quantity,ordered_item_quantity,taxes,total_sales OVER day FROM sales SINCE '+d1+' UNTIL '+d2;
break;
case 1:var shopifyQL = 'SHOW total_visitors, total_sessions,total_pageviews OVER day FROM visits SINCE '+d1+' UNTIL '+d2;
break;
case 2:var shopifyQL = 'SHOW orders BY day,customer_id FROM sales SINCE '+d1+' UNTIL '+d2;
break;
}
//var shopifyQL = 'SHOW orders BY day,customer_id FROM sales SINCE '+d1+' UNTIL '+d2;
    var renderData = function(response) {
//alert("OK");
//alert(response["result"]["data"]);
data=JSON.stringify(response["result"]["data"]);
var d1=$("#Sdate1").val();
var d2=$("#Sdate2").val();
var tt=$("#Stime").val();
//var db=($("#Sdb").is(":checked")?1:0);
switch(tttt){
shopify_query(1,result["time"]);
});break;
shopify_query(2,result["time"]);
});break;
$("#Sbtn_sub").val("查询");
$("#Sbtn_sub").prop("disabled",false);
});break;
}
 
//var msg ="";
         //   for(var name in response["result"]["data"]){
          //      msg += name+": "+ response["result"]["data"][name]+"\r\n ";
           // }
           // alert(msg);
 
      // do amazing things here
    };
    var handleError = function(response) {
alert(response);
$("#loading").hide();
      // handle missing API errors here (missing scopes, back shopifyql, etc...)
    };
    ShopifyApp.Analytics.fetch({
      query: shopifyQL,
      success: renderData,
      error: handleError
    });
  }
 
0 Likes
Highlighted
Shopify Staff
Shopify Staff
1040 139 165

Where in your code do you see this error?

0 Likes
Highlighted
Tourist
10 0 1

@scottydont When I run this code, the callback goes to handleError and response is "Staffmember ID is missing".

 

1.gif

0 Likes
Highlighted
Shopify Staff
Shopify Staff
1040 139 165

Thanks - do you have the store URL handy?

0 Likes