Apply filter on GET /beta/users/<user_id>/chats/getAllMessages fails

%3CLINGO-SUB%20id%3D%22lingo-sub-2584317%22%20slang%3D%22en-US%22%3EApply%20filter%20on%20GET%20%2Fbeta%2Fusers%2F%3CUSER_ID%3E%2Fchats%2FgetAllMessages%20fails%3C%2FUSER_ID%3E%3CLINGO-BODY%20id%3D%22lingo-body-2584317%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20I%20have%20a%20call%20at%20the%20endpoint%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-html%22%3E%3CCODE%3E%2Fbeta%2Fusers%2F%3CUSER_ID%3E%2Fchats%2FgetAllMessages%3F%24filter%3D%22lastModifiedDateTime%20gt%202021-07-18T00%3A00%3A00.000Z%22%3C%2FUSER_ID%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ewith%20the%20below%20code%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-python%22%3E%3CCODE%3Eurl%20%3D%20'%25sbeta%2Fusers%2F%25s%2Fchats%2FgetAllMessages%3F%24filter%3D%22lastModifiedDateTime%20gt%20%25sT00%3A00%3A00.000Z%22'%20%25%20(ms_api_url%2C%20user_id%2C%20before7days.strftime(%22%25Y-%25m-%25d%22))%20%0Aresponse%20%3D%20requests.get(url%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20headers%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20'Authorization'%3A%20'Bearer%20%25s'%20%25%20access_token%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D).json()%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ebut%20I%20am%20geting%20the%20below%20error%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-json%22%3E%3CCODE%3E%7B%0A%20%20'error'%3A%20%7B%0A%20%20%20%20'code'%3A%20'BadRequest'%2C%0A%20%20%20%20'message'%3A%20'Invalid%20filter%20clause'%2C%0A%20%20%20%20'innerError'%3A%20%7B%0A%20%20%20%20%20%20'date'%3A%20'2021-07-25T09%3A04%3A49'%2C%0A%20%20%20%20%20%20'request-id'%3A%20'590c724f-e161-44de-a8d9-a011dec40b6e'%2C%0A%20%20%20%20%20%20'client-request-id'%3A%20'590c724f-e161-44de-a8d9-a011dec40b6e'%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3Bwhat%20am%20I%20doing%20wrong%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2584317%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3C%2FLINGO-SUB%3E
Occasional Contributor

Hello I have a call at the endpoint:

 

/beta/users/<user_id>/chats/getAllMessages?$filter="lastModifiedDateTime gt 2021-07-18T00:00:00.000Z"

 

with the below code:

 

 

 

 

 

 

 

url = '%sbeta/users/%s/chats/getAllMessages?$filter="lastModifiedDateTime gt %sT00:00:00.000Z"' % (ms_api_url, user_id, before7days.strftime("%Y-%m-%d")) 
response = requests.get(url,
            headers = {
                'Authorization': 'Bearer %s' % access_token
            }).json()

 

 

 

 

 

but I am geting the below error:

 

 

 

 

 

{
  'error': {
    'code': 'BadRequest',
    'message': 'Invalid filter clause',
    'innerError': {
      'date': '2021-07-25T09:04:49',
      'request-id': '590c724f-e161-44de-a8d9-a011dec40b6e',
      'client-request-id': '590c724f-e161-44de-a8d9-a011dec40b6e'
    }
  }
}

 

 

 

 

 what am I doing wrong?

0 Replies