1

Error 7 when executing report

Тема: Error 7 when executing report

I am trying to execute the following report with the following request

hst-api.wialon.us/wialon/ajax.html?svc=report/exec_report&[
    params={
        "reportResourceId":400425038,
        "reportTemplateId":1,
        "reportObjectId":1,
        "reportObjectSecId":0,
        "interval":{
            "from":1672552800,
            "to":1679205540,
            "flags":0
        }
    }&sid="mySID"


but at the time of making the request he answers me with the

{
"error": 7
}

Could you help me to validate the reason for this error.

Thank you.

2

Error 7 when executing report

Re: Error 7 when executing report

gonzaloagd hello, looks like, the issue related to the Item ID in "reportObjectId":1 - there is no units with such internal ID in the system.
Since the report template created for the units, you need to set unit internal ID in reportObjectId parameter. In order to find unit internal ID, please, use search_items request.
For example: https://hst-api.wialon.com/wialon/ajax.html?svc=core/search_items&params={"spec":{"itemsType":"avl_unit","propName":"sys_name","propValueMask":"","sortType":"sys_name"},"force":1,"flags":1,"from":0,"to":0}&sid=ACTIVE_SID

Anton Zinovyev
Technical Care Engineer (L2)
Wialon
3

Error 7 when executing report

Re: Error 7 when executing report

Thanks for the reply.

If the report that I need to run is passenger assignment and the template type is "avl_tag_group", how do I get the "reportObjectId" if the report is not about units?

then I leave the answer of my search

{
"searchSpec": {
     "itemsType": "avl_resource",
     "propName": "sys_name",
     "propValueMask": "*",
     "sortType": "sys_name",
     "propType": "property",
     "or_logic": "0"
},
"dataFlags": 8193,
"totalItemsCount": 38,
"indexFrom": 0,
"indexTo": 0,
"items": [
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{
     "nm": "GtrackMx",
     "cls": 3,
     "id": 400425038,
     "mu": 0,
     "rep": {
          "1": {},
          "2": {},
          "3": {},
          "4": {},
          "5": {},
          "6": {
             "id": 6,
              "n": "PASAJEROS",
              "ct": "avl_tags_group",
              "c": 27935

4

Error 7 when executing report

Re: Error 7 when executing report

gonzaloagd hello, if you need to execute report for micro-objects, such as drivers, trailers or geofences, you need to specify their ID in the reportObjectSecId parameter
In this case the reportObjectId should content the ID of the resource were driver created.
So, you need to find driver ID as well with search_items request by avl_resource with flags value 257.
Then use driver ID and corresponding resource ID in the reportObjectSecId and reportObjectId parameters respectively.

Anton Zinovyev
Technical Care Engineer (L2)
Wialon
5

Error 7 when executing report

Re: Error 7 when executing report

Thanks for the prompt response.

Do the search with the flag 257 and the answer is the following.

SEARCH
hst-api.wialon.com/wialon/ajax.html?svc=core/search_items&params={"spec":{"itemsType":"avl_resource","propName":"sys_name","propValueMask":"*", "sortType":"sys_name","propType":"property","or_logic":0},"force":1,"flags":257,"from":0,"to":0}&sid=" MYSID"

and the answer is:

"searchSpec": {
       "itemsType": "avl_resource",
       "propName": "sys_name",
      "propValueMask": "*",
      "sortType": "sys_name",
      "propType": "property",
      "or_logic": "0"
},
"dataFlags": 257,
"totalItemsCount": 38,
"indexFrom": 0,
"indexTo": 0,
"items": [
    {},
    {},
    {},
    {},
    {},
    {},
    {},
    {},
    {},
    {},
   {},
{
    "nm": "GtrackMx",
    "cls": 3,
    "id": 400425038,
    "mu": 0,
   "drvrs": {},
   "drvrsmax": -1,
   "uacl": 17627904754211
},

The resource ID,reportObjectSecId and reportObjectId is "400425038"?

6

Error 7 when executing report

Re: Error 7 when executing report

gonzaloagd hello, based on the reply there are no drivers created in GtrackMx resource "drvrs": {}. Presumably, they created in different resources under the GtrackMx account. Please, check the exact resource where the drivers are created and try to use its name in "propValueMask": "RESOURCE_NAME". If the issue stills, please, send your request and token to support@gurtam.com and we will investigate this case in details.

Anton Zinovyev
Technical Care Engineer (L2)
Wialon
7

Error 7 when executing report

Re: Error 7 when executing report

Thanks for the answers.

It is correct within the GTrack resource, there are no drivers created, but the report that I need to run is about the assignment of passengers, not drivers.

Searching for the passengers I get the following.
{
"searchSpec": {
"itemsType": "avl_resource",
"propName": "sys_name",
"propValueMask": "*",
"sortType": "sys_name",
"propType": "property",
"or_logic": "0"
},
"dataFlags": 2097152,
"totalItemsCount": 38,
"indexFrom": 0,
"indexTo": 0,
"items": [
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{
"tags": {
"1": {
"id": 1,
"n": "LUIS PEREZ",
"c": "46815267",
"jp": {
"ID": "1425",
"OFICINA": "25",
"TURNO": "MAT"
},
"r": 2,048,
"ck": 758826348,
"f": 1,
"buh": 0,
"pu": 400887724,
"bt": 1678554850,
"tz": 4194806688,
"art": 36000,
"post": {
"and": 19.7942699,
"x": -99.0657633
},
"ct": 1678553229,
"mt": 1679196107
},
"2": {
"id": 2,
"n": "SERGIO MENDEZ",
"c": "46815269",
"jp": {
"ID": "7485",
"OFICINA": "20",
"TURNO": "VESP"
},
"r": 1.08445945946,
"ck": 875533921,
"f": 1,
"buh": 0,
"pu": 400887724,
"bt": 1679282587,
"tz": 4194806688,
"art": 36000,
"post": {
"and": 19.794245,
"x": -99.06571
},
"ct": 1678553255,
"mt": 1679196115
}

SEARCH BY GROUP OF PASSENGERS
{
"searchSpec": {
"itemsType": "avl_resource",
"propName": "sys_name",
"propValueMask": "*",
"sortType": "sys_name",
"propType": "property",
"or_logic": "0"
},
"dataFlags": 8388608,
"totalItemsCount": 38,
"indexFrom": 0,
"indexTo": 0,
"items": [
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{
"tagsgr": {
"1": {
"id": 1,
"n": "TEST",
"d": "",
"tgs": [
1,
2
],
"ct": 1678555020,
"mt": 1678555032
}
},
"tagsgrmax": -1

Within these searches are the reportObjectSecId and reportObjectId?

8

Error 7 when executing report

Re: Error 7 when executing report

gonzaloagd hello, if all these passengers and group of passengers created in GtrackMx resource, then:
"reportObjectId":400425038
"reportObjectSecId":1 -- if this is for group.

In case you request info for each passenger separately (depends on the report template type) then you need to put in "reportObjectSecId" specific passenger's ID.
For example for SERGIO MENDEZ passenger ID is 2 - this value you need to set.

Anton Zinovyev
Technical Care Engineer (L2)
Wialon
9

Error 7 when executing report

Re: Error 7 when executing report

Thanks for the support, I already managed to run the report.