Ask the Community
Groups
BMS API: When using a filter in a call with Date / Time object I get an Error 400. - Connect IT Community | Kaseya
<main> <article class="userContent"> <p><strong>Question: </strong>I am trying to use a filter on dates in the API call and I get a status failed response; how can I resolve this? </p> <p>"<em>A binary operator with incompatible types was detected. Found operand types 'Edm.DateTime' and 'Edm.String' for operator kind 'LessThan'</em>".</p> <p><img src="https://us.v-cdn.net/6032361/uploads/migrated/GVHXQ9P0VQ44/mceclip0.png" alt="image" class="embedImage-img importedEmbed-img"></img></p> <p><strong>Resolution: </strong>This occurs when <em>Edm.String</em> is used; use the Edm type <strong>datetime </strong>instead.</p> <p><strong>Examples:</strong></p> <p><strong>1. </strong><a href="/home/leaving?allowTrusted=1&target=https%3A%2F%2Fserverurl%2Fapi%2Fservicedesk%2Ftickets%2Ftimelogs%3F%24filter%3DStartDate">https://serverurl/api/servicedesk/tickets/timelogs?$filter=StartDate</a> lt '2019-01-21T21:44:45.257'<br><br><strong>2. </strong>$filter=OpenDate eq DateTime'2018-09-21T21:44:45.257</p> </article> </main>