Skip to main content

Common API Structure

There are certain characteristics that remain consistent across all service suites.

SID

The SID is a numerical key that identifies all fab4minds objects. The SID also helps to distinguish if an object should be created or updated when savecontainers API is called

Example

This json object has no SID set, therefore it should be created

"object": {
"name": {
"value": "test",
"modified": true
}
}

This json object has a SID, therefore it should be updated

"object": {
"sid": {
"value": 1234
},
"name": {
"value": "test",
"modified": true
}
}

Object Values

Object Values are used to add additional information to the values of the attributes of an object.

Example

Given a table object with the columns A and B:

Saving this object:

"object": {
"A": {
"value": "test A"
},
"B": {
"value": "test B"
}
}

would create this record:
SID - 1
A - "test A"
B - "test B"

Saving this object:

"object": {
"sid": {
"value": 1
},
"A": {
"value": "test C",
"modified": true
}
}

would update the record to these values:
SID - 1
A - "test C"
B - "test B"

After saving this object:

"object": {
"sid": {
"value": 1
},
"B": {
"value": "test D"
}
}

the record still would be:
SID - 1
A - "test C"
B - "test B"

If the object contains a SID but NO modification status, values will NOT get updated!

Json Impl

The APIs of fab4minds are used by f4m webshops, external webshops, portals,...
To present only the relevant data there are custom json implementations. To ensure the correct implementation is used objects must contain the jsonImpl (as shown in the postman collection)
Additionally the header of all requests must contain the variable X-Json-Impl-ID with the correct implementation.

Record State

The RecordState defines whether or not data is valid.

The relevant RecordStates are:
0 - valid
1 - archive
2 - erased

This means in order to deleate an object, the save contaiers request would contain an object looking like this:

"object": {
"sid": {
"value": 1
},
"recordStateSid": {
"value": 2,
"modified": true
}
}