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 ---
- <?xml
version='1.0' encoding='UTF-8'?>
-
<API version='1.0' locale='en'>
-
<citype>
-
<name>All Assets</name>
-
<criterias>
-
<criteria>
-
<parameter>
-
<name compOperator="CONTAINS">Barcode</name>
-
<value>185999</value>
-
</parameter>
-
</criteria>
-
</criterias>
-
<returnFields>
-
<name>CI Name</name>
-
<name>Org Serial Number</name>
-
<name>Product Name</name>
-
<name>Asset State</name>
-
</returnFields>
-
</citype>
-
</API>
--- answer
in json ---
- {
-
"API": {
-
"response": {
-
"operation": {
-
"result": {
-
"statuscode": 200,
-
"message": "Successfully fetched.",
-
"created-date": "2024/06/03 13:30",
-
"status": "Success"
-
},
-
"Details": {
-
"field-values": {
-
"totalRecords": 1,
-
"record": {
-
"value": [
-
185999,
-
"FOL2544YQCR",
-
"C9300+48P+A V05",
-
"In Store"
-
]
-
}
-
},
-
"field-names": {
-
"name": [
-
{
-
"type": "String",
-
"content": "CI Name"
-
},
-
{
-
"type": "String",
-
"content": "Org Serial Number"
-
},
-
{
-
"type": "String",
-
"content": "Product Name"
-
},
-
{
-
"type": "String",
-
"content": "Asset State"
-
}
-
]
-
}
-
},
-
"name": "read"
-
}
-
},
-
"locale": "en",
-
"version": 1
-
}
-
}
--------------------------------------------------------------------------
Second
example
--------------------------------------------------------------------------
---
question in XML ---
- <?xml
version='1.0' encoding='UTF-8'?>
-
<API version='1.0' locale='en'>
-
<citype>
-
<name>Switch</name>
-
<criterias>
-
<criteria>
-
<parameter>
-
<name compOperator="CONTAINS">Barcode</name>
-
<value>185999</value>
-
</parameter>
-
</criteria>
-
</criterias>
-
<returnFields>
-
<name>CI Name</name>
-
<name>CI Type</name>
-
<name>Org Serial Number</name>
-
<name>Product Name</name>
-
<name>Asset State</name>
-
</returnFields>
-
</citype>
-
</API>
--- answer
in json ---
- {
-
"API": {
-
"response": {
-
"operation": {
-
"result": {
-
"statuscode": 200,
-
"message": "Successfully fetched.",
-
"created-date": "2024/06/03 13:46",
-
"status": "Success"
-
},
-
"Details": {
-
"field-values": {
-
"record": {
-
"value": [
-
185999,
-
"FOL2544YQCR",
-
"C9300+48P+A V05",
-
"In Store"
-
]
-
}
-
},
-
"field-names": {
-
"name": [
-
{
-
"type": "String",
-
"content": "CI Name"
-
},
-
{
-
"type": "String",
-
"content": "Org Serial Number"
-
},
-
{
-
"type": "String",
-
"content": "Product Name"
-
},
-
{
-
"type": "String",
-
"content": "Asset State"
-
},
-
{
-
"type": "String",
-
"content":
"CI Type"
-
}
-
]
-
}
-
},
-
"name": "read"
-
}
-
},
-
"locale": "en",
-
"version": 1
-
}
-
}