1493
Views
1
Comments
date format in rest api request
Question

create a rest api that accept date as input

when i call this api

&FromDate="2019-12-24"&ToDate="2019-12-24"&PRODUCER_Code="PAG001"&PROM_CODE

but the api call return error

{"Errors":["Failed to parse. 'Date' compatible data type is required for parameter 'FromDate'.","Failed to parse. 'Date' compatible data type is required for parameter 'ToDate'."],"StatusCode":400}

tried

"2015-01-01T19:00:00.256"

"2014-12-31T23:59:59+01:00"

 "/Date(1388534400000)/"

https://success.outsystems.com/Documentation/10/Reference/OutSystems_Language/Extensibility_and_Integration/REST_APIs/Consumed_REST_API/Mapping_REST_Data_Types_to_OutSystems_Data_Types


appreciate your help.


2021-04-09 11-42-43
assif_tiger
 
MVP

Linguo You wrote:

create a rest api that accept date as input

when i call this api

&FromDate="2019-12-24"&ToDate="2019-12-24"&PRODUCER_Code="PAG001"&PROM_CODE

but the api call return error

{"Errors":["Failed to parse. 'Date' compatible data type is required for parameter 'FromDate'.","Failed to parse. 'Date' compatible data type is required for parameter 'ToDate'."],"StatusCode":400}

tried

"2015-01-01T19:00:00.256"

"2014-12-31T23:59:59+01:00"

 "/Date(1388534400000)/"

https://success.outsystems.com/Documentation/10/Reference/OutSystems_Language/Extensibility_and_Integration/REST_APIs/Consumed_REST_API/Mapping_REST_Data_Types_to_OutSystems_Data_Types


appreciate your help.


Hi,

Declare that parameter as of type DateTime

Documentaion DataType Sample:

Date :

{"createdon" : "2014-12-24"}DateFormat: YYYY-MM-DD


DateTime :

{"createdon" : "2014-12-31T23:59:59+01:00",
            "shippedon" : "2015-01-01T19:00:00.256"}
Date TimeIf the ISO date contains information about the time zone, it is automatically converted to the local time of the server, with daylight savings applied.
{"scheduledstart" : "/Date(1388534400000)/"}Date TimeWCF format



thanks


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.