How to get CI Type

How to get CI Type

Here are two examples from SDP 14.5.

 

The problem is to get the CI Type of an object.

First example below is without "CI Type" in the question.

We get an answer with "totalRecords": 1.

This is needed to know if the answer is a single dict or if more the 1 record it is a list.

 

Second example is with "CI Type" in the question.

Now we don´t get the "totalRecords" object and we don´t get the CI Type either.

 

What have changed in the API and how do I get the CI Type?

 

--------------------------------------------------------------------------

First example

--------------------------------------------------------------------------

--- question in XML ---

  1. <?xml version='1.0' encoding='UTF-8'?>
  2.     <API version='1.0' locale='en'>
  3.         <citype>
  4.             <name>All Assets</name>
  5.             <criterias>
  6.                 <criteria>
  7.                     <parameter>
  8.                         <name compOperator="CONTAINS">Barcode</name>
  9.                         <value>185999</value>
  10.                     </parameter>
  11.                 </criteria>
  12.             </criterias>
  13.             <returnFields>
  14.                 <name>CI Name</name>
  15.                 <name>Org Serial Number</name>
  16.                 <name>Product Name</name>
  17.                 <name>Asset State</name>
  18.             </returnFields>
  19.         </citype>
  20.     </API>

--- answer in json ---

  1. {
  2.   "API": {
  3.     "response": {
  4.       "operation": {
  5.         "result": {
  6.           "statuscode": 200,
  7.           "message": "Successfully fetched.",
  8.           "created-date": "2024/06/03 13:30",
  9.           "status": "Success"
  10.         },
  11.         "Details": {
  12.           "field-values": {
  13.             "totalRecords": 1,
  14.             "record": {
  15.               "value": [
  16.                 185999,
  17.                 "FOL2544YQCR",
  18.                 "C9300+48P+A V05",
  19.                 "In Store"
  20.               ]
  21.             }
  22.           },
  23.           "field-names": {
  24.             "name": [
  25.               {
  26.                 "type": "String",
  27.                 "content": "CI Name"
  28.               },
  29.               {
  30.                 "type": "String",
  31.                 "content": "Org Serial Number"
  32.               },
  33.               {
  34.                 "type": "String",
  35.                 "content": "Product Name"
  36.               },
  37.               {
  38.                 "type": "String",
  39.                 "content": "Asset State"
  40.               }
  41.             ]
  42.           }
  43.         },
  44.         "name": "read"
  45.       }
  46.     },
  47.     "locale": "en",
  48.     "version": 1
  49.   }
  50. }

 

--------------------------------------------------------------------------

Second example

--------------------------------------------------------------------------

--- question in XML ---

  1. <?xml version='1.0' encoding='UTF-8'?>
  2.     <API version='1.0' locale='en'>
  3.         <citype>
  4.             <name>Switch</name>
  5.             <criterias>
  6.                 <criteria>
  7.                     <parameter>
  8.                         <name compOperator="CONTAINS">Barcode</name>
  9.                         <value>185999</value>
  10.                     </parameter>
  11.                 </criteria>
  12.             </criterias>
  13.             <returnFields>
  14.                 <name>CI Name</name>
  15.                 <name>CI Type</name>
  16.                 <name>Org Serial Number</name>
  17.                 <name>Product Name</name>
  18.                 <name>Asset State</name>
  19.             </returnFields>
  20.         </citype>
  21.     </API>

--- answer in json ---

  1. {
  2.   "API": {
  3.     "response": {
  4.       "operation": {
  5.         "result": {
  6.           "statuscode": 200,
  7.           "message": "Successfully fetched.",
  8.           "created-date": "2024/06/03 13:46",
  9.           "status": "Success"
  10.         },
  11.         "Details": {
  12.           "field-values": {
  13.             "record": {
  14.               "value": [
  15.                 185999,
  16.                 "FOL2544YQCR",
  17.                 "C9300+48P+A V05",
  18.                 "In Store"
  19.               ]
  20.             }
  21.           },
  22.           "field-names": {
  23.             "name": [
  24.               {
  25.                 "type": "String",
  26.                 "content": "CI Name"
  27.               },
  28.               {
  29.                 "type": "String",
  30.                 "content": "Org Serial Number"
  31.               },
  32.               {
  33.                 "type": "String",
  34.                 "content": "Product Name"
  35.               },
  36.               {
  37.                 "type": "String",
  38.                 "content": "Asset State"
  39.               },
  40.               {
  41.                 "type": "String",
  42.                 "content": "CI Type"
  43.               }
  44.             ]
  45.           }
  46.         },
  47.         "name": "read"
  48.       }
  49.     },
  50.     "locale": "en",
  51.     "version": 1
  52.   }
  53. }

                New to ADSelfService Plus?