What's meaning "StaffMember ID is missing"?

Solved
CharlieZ
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. 

Accepted Solution (1)
SBD_
Shopify Staff
Shopify Staff
1098 146 229

This is an accepted solution.

Just tweaked an app setting from this end. Please try again + confirm this has been resolved.

Scott | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

View solution in original post

Replies 18 (18)
SBD_
Shopify Staff
Shopify Staff
1098 146 229

Hey @CharlieZ 

 

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

Scott | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

CharlieZ
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.

CharlieZ
Tourist
10 0 1
Hi Scott,

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

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


@SBD_ wrote:

Hey @CharlieZ 

 

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


 

CharlieZ
Tourist
10 0 1

@SBD_ 

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
    });
  }
 
SBD_
Shopify Staff
Shopify Staff
1098 146 229

Where in your code do you see this error?

Scott | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

CharlieZ
Tourist
10 0 1

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

 

1.gif

SBD_
Shopify Staff
Shopify Staff
1098 146 229

Thanks - do you have the store URL handy?

Scott | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

SBD_
Shopify Staff
Shopify Staff
1098 146 229

Thanks. And with the Data Analytics app open, what are the steps to replicate the error?

Scott | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

CharlieZ
Tourist
10 0 1

@SBD_  just simply press "Query" button, thanks.

 

QQ图片20200518154848.png

SBD_
Shopify Staff
Shopify Staff
1098 146 229

This is an accepted solution.

Just tweaked an app setting from this end. Please try again + confirm this has been resolved.

Scott | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

CharlieZ
Tourist
10 0 1

It works, thank you very much.

ClementBR
Shopify Partner
139 2 40

@SBD_  we started receiving that same error.

"StaffMember ID is missing"

 

How do we fix it?

SBD_
Shopify Staff
Shopify Staff
1098 146 229

Looks like a bug on our end @ClementBR. A fix is in the works, keep you posted.

Scott | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

ClementBR
Shopify Partner
139 2 40

Ok, that's good to get a confirmation.

We're looking forward to this fix.

SBD_
Shopify Staff
Shopify Staff
1098 146 229

@ClementBR a fix has shipped. Let me know if you hit any issues.

Scott | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

ClementBR
Shopify Partner
139 2 40

Thank you, it's working again 🙂