Je ne reproduis pas ce que vous indiquez => en 5.1.52 les API mapped supportent bien la syntaxe <min date>;<max date>
conformément à ce qui est dit dans la release note (elles ne supportent pas les syntaxes avec prefix dmin__
et dmax__
)
Vous devez faire une erreur dans votre syntaxe d’appel ou vous êtes dans un cas particulier qu’il va falloir nous détailler.
Exemple:
Obtention du token:
export TOKEN=`curl -s -u designer:Passw0rd "https://testdaz51.dev.simplicite.io/api/login"`
Appel API standard avec filtre de période:
curl -s -H "Authorization: Bearer $TOKEN" "https://testdaz51.dev.simplicite.io/api/rest/Responsability?rsp_start_dt=2020-01-01;2023-01-01" | jq '.'
[
{
"row_id": "76",
"rsp_login_id": "1",
"rsp_login_id__usr_login": "designer",
"rsp_group_id": "10",
"rsp_group_id__grp_name": "APP_ADMIN",
"rsp_start_dt": "2022-10-20",
"rsp_end_dt": null,
"rsp_activ": true,
"row_module_id": "31",
"row_module_id__mdl_name": "ApplicationUsers"
}
]
Appel API mappée avec le même filtre:
curl -s -H "Authorization: Bearer $TOKEN" "https://testdaz51.dev.simplicite.io/api/ext/TestAPI/resp?date=2020-01-01;2023-01-01" | jq '.'
{
"resp": [
{
"date": "2022-10-20",
"row_id": "76",
"login": "designer",
"group": "APP_ADMIN"
}
]
}
Appel API mappée avec filtre plus large:
curl -s -H "Authorization: Bearer $TOKEN" "https://testdaz51.dev.simplicite.io/api/ext/TestAPI/resp?date=2000-01-01;2023-01-01" | jq '.'
{
"resp": [
{
"date": "2000-01-01",
"row_id": "42",
"login": "designer",
"group": "ADMIN"
},
{
"date": "2022-10-20",
"row_id": "76",
"login": "designer",
"group": "APP_ADMIN"
},
{
"date": "2000-01-01",
"row_id": "56",
"login": "designer",
"group": "DESIGNER"
},
{
"date": "2000-01-01",
"row_id": "61",
"login": "designer",
"group": "GRANT_ADMIN"
},
{
"date": "2000-01-01",
"row_id": "73",
"login": "designer",
"group": "MD_ADMIN"
},
{
"date": "2000-01-01",
"row_id": "68",
"login": "designer",
"group": "MODELER"
},
{
"date": "2000-01-01",
"row_id": "57",
"login": "designer",
"group": "OPERATOR"
},
{
"date": "2000-01-01",
"row_id": "71",
"login": "designer",
"group": "SOCIAL_ADMIN"
},
{
"date": "2000-01-01",
"row_id": "64",
"login": "designer",
"group": "USER_ADMIN"
},
{
"date": "2000-01-01",
"row_id": "66",
"login": "designer",
"group": "WEB_ADMIN"
},
{
"date": "2000-01-01",
"row_id": "75",
"login": "public",
"group": "MD_READER"
},
{
"date": "2006-10-01",
"row_id": "52",
"login": "public",
"group": "PUBLIC"
}
]
}
Voici l’API mappée utilisée:
package com.simplicite.extobjects.Application;
import com.simplicite.util.tools.Parameters;
public class TestAPI extends com.simplicite.webapp.services.RESTMappedObjectsExternalObject {
private static final long serialVersionUID = 1L;
@Override
public void init(Parameters params) {
addObject("resp", "Responsability");
addField("resp", "login", "rsp_login_id.usr_login");
addField("resp", "group", "rsp_group_id.grp_name");
addField("resp", "date", "rsp_start_dt");
}
}
Vous pouvez tester sur cette instance https://testdaz51.dev.simplicite.io qui est toujours active (designer/Passw0rd)