2025-07-29- Action EndPoint: Difference between revisions
Jump to navigation
Jump to search
(Created page with "== Create EndPoint == === Create Basic === ''' requestParam ''' <source lang="json"> { "objectType": "xxxxx", "fieldNames": { //fields or if have fields of versionedData } } </source> ''' returnOutput ''' <syntaxhighlight lang="javascript"> { "objType": { "objectType": "xxxxx", "serviceTag": "yyyyy" }, "objInstanceFull": { "identifiers": { //identifiers }, "fields": { //fields } }, "relationships": [], "status": "complete", // or...") |
|||
| (23 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
= Action Endpoint Test = | |||
* Note!: Can Test endpoint can test by API Gateway | |||
''' Test API Work Flow ''' | |||
[[File:Test API Work Flow.png|frame|center|Work Flow Diagram]] | |||
== Create EndPoint == | == Create EndPoint == | ||
=== Create Basic === | === Create Basic === | ||
''' | ''' Request Parameters ''' | ||
< | * objectType | ||
** Type: string | |||
** Required: true | |||
* fieldNames | |||
** Type: object | |||
** Required: true | |||
** Description: if objectType have versionedData can send fields of versionedData to created | |||
''' Request Example''' | |||
<syntaxhighlight lang="javascript"> | |||
{ | { | ||
"objectType": "xxxxx", | "objectType": "xxxxx", | ||
"fieldNames": { | "fieldNames": { | ||
//fields or if have fields of versionedData | // fields or if have fields of versionedData | ||
} | } | ||
} | } | ||
</ | </syntaxhighlight> | ||
''' | ''' Output Response ''' | ||
* objType | |||
** Type: object | |||
** Description: return objectType and serviceTag | |||
* objInstanceFull | |||
** Type: object | |||
** Description: return identifiers and fields of objectType | |||
* relationships | |||
** Type: array | |||
** Description: return empty array if not send create with relationship | |||
* Status | |||
** Type: string | |||
** Description: if correct return: “complete” , f invalid return “error” | |||
* errorsFound | |||
** Type: array | |||
** Description: return value if have which condition invalid | |||
''' Return Example ''' | |||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
{ | { | ||
objType: { | |||
objectType: "xxxxx", | |||
serviceTag: "yyyyy" | |||
}, | }, | ||
objInstanceFull: { | |||
identifiers: { | |||
//identifiers | //identifiers | ||
}, | }, | ||
fields: { | |||
//fields | //fields | ||
} | } | ||
}, | }, | ||
relationships: [], | |||
status: "complete", // or "error" | |||
errorsFound: [] | |||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== Create | === Create Object and Relationship === | ||
''' | ''' Request Parameters ''' | ||
< | * objectType | ||
** Type: string | |||
** Required: true | |||
* fieldNames | |||
** Type: object | |||
** Required: true | |||
** Description: if objectType have versionedData can send fields of versionedData to created | |||
* relationships | |||
** Type: array | |||
** Required: optional | |||
** Description: can create node and relationships to targetNode | |||
* relationships.relType | |||
** Type: Object | |||
** Required: true | |||
* relationships.targetObjType | |||
** Type: Object | |||
** Required: true | |||
* relationships.relationshipDirection | |||
** Type: String | |||
** Required: true | |||
* relationships.targetIdentifiers | |||
** Type: Object | |||
** Required: true | |||
''' Request Example ''' | |||
<syntaxhighlight lang="javascript"> | |||
{ | { | ||
"objectType": "xxxx", | "objectType": "xxxx", | ||
| Line 40: | Line 95: | ||
// fields or if have fields of versionedData | // fields or if have fields of versionedData | ||
}, | }, | ||
"relationships": [ | "relationships": [ // optional | ||
{ | { | ||
"relType": { | "relType": { | ||
| Line 57: | Line 112: | ||
] | ] | ||
} | } | ||
</ | </syntaxhighlight> | ||
''' | |||
''' Output Response ''' | |||
* objType | |||
** Type: object | |||
** Description: return objectType and serviceTag | |||
* objInstanceFull | |||
** Type: object | |||
** Description: return identifiers and fields of objectType | |||
* relationships | |||
** Type: array | |||
** Description: return data object of create Relationships | |||
* relationships.relType | |||
** Type: object | |||
* relationships.targetObjType | |||
** Type: object | |||
* relationships.relationshipDirection | |||
** Type: string | |||
* relationships.targetIdentifiers | |||
** Type: object | |||
* Status | |||
** Type: string | |||
** Description: if correct return: “complete” , if invalid return “error” | |||
* errorsFound | |||
** Type: array | |||
**Description: return value if have which condition invalid | |||
''' Return Example ''' | |||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
{ | { | ||
"objType":{ | |||
"objectType":"xxxx", | |||
"serviceTag":"yyyy" | |||
}, | }, | ||
"relationships": [ | "objInstanceFull":{ | ||
"identifiers":{ | |||
// identifiers | |||
}, | |||
"fields":{ | |||
// fields | |||
} | |||
}, | |||
"relationships":[ | |||
{ | |||
"relType":{ | |||
"serviceTag":"xxxx", | |||
"relationshipTag":"rel" | |||
}, | |||
"targetObjType":{ | |||
"serviceTag":"xxxx", | |||
"objectType":"yyyy" | |||
}, | |||
"relationshipDirection":"from", // or to | |||
"targetIdentifiers":{ | |||
// targetIdentifiers | |||
} | |||
} | } | ||
], | |||
"status":"complete", // or 'error' | |||
"errorsFound":[] | |||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Test Create API Gateway === | |||
* Copy invoke URL for create in postman Type: PUT | |||
* Body Parameter : not send objectType in parameter , but must to send every fieldNames in objectSchema that have requiredOnCreate = true | |||
* storageResources : dynamoDB or graph (Cloudwatch) | |||
== Update EndPoint == | == Update EndPoint == | ||
''' | ''' Request Parameters ''' | ||
< | * objectType | ||
** Type: string | |||
** Required: true | |||
* objInstanceFull | |||
** Type: object | |||
** Required: true | |||
* objInstanceFull.identifiers | |||
** Type: object | |||
** Required: true | |||
* objInstanceFull.fields | |||
** Type: object | |||
** Required: true | |||
** Description: if objectType have versionedData can send fields of versionedData to created | |||
* versionedDataIds | |||
** Type: object | |||
** Required: optional | |||
''' Request Example ''' | |||
<syntaxhighlight lang="javascript"> | |||
{ | { | ||
"objectType": "xxxxx", | "objectType": "xxxxx", | ||
"objInstanceFull": { // required | |||
"identifiers": { | "identifiers": { | ||
//identifiers | |||
}, | }, | ||
"fields": { | "fields": { | ||
// fields or if have fields of versionedData | |||
} | } | ||
}, | |||
"versionedDataIds": { // optional | |||
// “versionedDataLabel”: versionedDataIds | |||
} | } | ||
} | } | ||
</ | |||
''' | </syntaxhighlight> | ||
''' Output Response ''' | |||
* objType | |||
** Type: object | |||
** Description: return objectType and serviceTag | |||
* objInstanceFull | |||
** Type: object | |||
** Description: return identifiers and fields of objectType | |||
* versionedDataIds | |||
** Type: object | |||
** Description: In case not send versionedDataIds: Every filedName in requestParams will be update >> If In case send versionedDataIds: If send fieldName not in versionedData will throw error | |||
* Status | |||
** Type: string | |||
** Description: if correct return: “complete” , if invalid return “error” | |||
* errorsFound | |||
** Type: array | |||
** Description: return value if have which condition invalid | |||
''' Return Example ''' | |||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
{ | { | ||
returnValues: { | |||
objType: { | |||
objectType: "xxxxx", | |||
serviceTag: "yyyyy" | |||
}, | }, | ||
objInstanceFull: { | |||
identifiers: { | |||
//identifiers | //identifiers | ||
}, | }, | ||
fields: { | |||
//fields | //fields | ||
} | } | ||
}, | }, | ||
versionedDataIds: { | |||
// if send fields of versionedData will return versionedDataIds | // if send fields of versionedData will return versionedDataIds | ||
} | } | ||
}, | }, | ||
status:"complete", // or "error" | |||
errorsFound: [] | |||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Test Update API Gateway === | |||
* Copy invoke URL for get in postman Type: POST | |||
* Body Parameter: not send objectType in parameter , just send “objInstanceFull” and fields want to update | |||
== Get EndPoint == | == Get EndPoint == | ||
''' | ''' Request Parameters''' | ||
< | * objectType | ||
** Type: string | |||
** Required: true | |||
* identifiers | |||
** Type: object | |||
** Required: true | |||
''' Request Example ''' | |||
<syntaxhighlight lang="javascript"> | |||
{ | { | ||
"objectType": "xxxxx", | "objectType": "xxxxx", | ||
| Line 133: | Line 280: | ||
} | } | ||
} | } | ||
</ | </syntaxhighlight> | ||
''' | |||
''' Output Response ''' | |||
* Identifiers | |||
** Type: object | |||
* fields | |||
** Type: object | |||
** Description: will be return all fields in database | |||
''' Return Example ''' | |||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
{ | { | ||
| Line 147: | Line 302: | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Test Get API Gateway === | |||
* Copy invoke URL for get in postman Type: FrontEnd use POST or GET | |||
* Body Parameter: just send “identifiers” | |||
[[Category:Working documents| 2025-07-30]] | |||
Latest revision as of 08:27, 30 July 2025
Action Endpoint Test
- Note!: Can Test endpoint can test by API Gateway
Test API Work Flow
Create EndPoint
Create Basic
Request Parameters
- objectType
- Type: string
- Required: true
- fieldNames
- Type: object
- Required: true
- Description: if objectType have versionedData can send fields of versionedData to created
Request Example
{
"objectType": "xxxxx",
"fieldNames": {
// fields or if have fields of versionedData
}
}
Output Response
- objType
- Type: object
- Description: return objectType and serviceTag
- objInstanceFull
- Type: object
- Description: return identifiers and fields of objectType
- relationships
- Type: array
- Description: return empty array if not send create with relationship
- Status
- Type: string
- Description: if correct return: “complete” , f invalid return “error”
- errorsFound
- Type: array
- Description: return value if have which condition invalid
Return Example
{
objType: {
objectType: "xxxxx",
serviceTag: "yyyyy"
},
objInstanceFull: {
identifiers: {
//identifiers
},
fields: {
//fields
}
},
relationships: [],
status: "complete", // or "error"
errorsFound: []
}
Create Object and Relationship
Request Parameters
- objectType
- Type: string
- Required: true
- fieldNames
- Type: object
- Required: true
- Description: if objectType have versionedData can send fields of versionedData to created
- relationships
- Type: array
- Required: optional
- Description: can create node and relationships to targetNode
- relationships.relType
- Type: Object
- Required: true
- relationships.targetObjType
- Type: Object
- Required: true
- relationships.relationshipDirection
- Type: String
- Required: true
- relationships.targetIdentifiers
- Type: Object
- Required: true
Request Example
{
"objectType": "xxxx",
"fieldNames": {
// fields or if have fields of versionedData
},
"relationships": [ // optional
{
"relType": {
"serviceTag": "xxxx",
"relationshipTag": "rel"
},
"targetObjType": {
"serviceTag": "xxxx",
"objectType": "yyyy"
},
"relationshipDirection": "xxxx", // 'from' or 'to'
"targetIdentifiers": {
// identifiers
}
}
]
}
Output Response
- objType
- Type: object
- Description: return objectType and serviceTag
- objInstanceFull
- Type: object
- Description: return identifiers and fields of objectType
- relationships
- Type: array
- Description: return data object of create Relationships
- relationships.relType
- Type: object
- relationships.targetObjType
- Type: object
- relationships.relationshipDirection
- Type: string
- relationships.targetIdentifiers
- Type: object
- Status
- Type: string
- Description: if correct return: “complete” , if invalid return “error”
- errorsFound
- Type: array
- Description: return value if have which condition invalid
Return Example
{
"objType":{
"objectType":"xxxx",
"serviceTag":"yyyy"
},
"objInstanceFull":{
"identifiers":{
// identifiers
},
"fields":{
// fields
}
},
"relationships":[
{
"relType":{
"serviceTag":"xxxx",
"relationshipTag":"rel"
},
"targetObjType":{
"serviceTag":"xxxx",
"objectType":"yyyy"
},
"relationshipDirection":"from", // or to
"targetIdentifiers":{
// targetIdentifiers
}
}
],
"status":"complete", // or 'error'
"errorsFound":[]
}
Test Create API Gateway
- Copy invoke URL for create in postman Type: PUT
- Body Parameter : not send objectType in parameter , but must to send every fieldNames in objectSchema that have requiredOnCreate = true
- storageResources : dynamoDB or graph (Cloudwatch)
Update EndPoint
Request Parameters
- objectType
- Type: string
- Required: true
- objInstanceFull
- Type: object
- Required: true
- objInstanceFull.identifiers
- Type: object
- Required: true
- objInstanceFull.fields
- Type: object
- Required: true
- Description: if objectType have versionedData can send fields of versionedData to created
- versionedDataIds
- Type: object
- Required: optional
Request Example
{
"objectType": "xxxxx",
"objInstanceFull": { // required
"identifiers": {
//identifiers
},
"fields": {
// fields or if have fields of versionedData
}
},
"versionedDataIds": { // optional
// “versionedDataLabel”: versionedDataIds
}
}
Output Response
- objType
- Type: object
- Description: return objectType and serviceTag
- objInstanceFull
- Type: object
- Description: return identifiers and fields of objectType
- versionedDataIds
- Type: object
- Description: In case not send versionedDataIds: Every filedName in requestParams will be update >> If In case send versionedDataIds: If send fieldName not in versionedData will throw error
- Status
- Type: string
- Description: if correct return: “complete” , if invalid return “error”
- errorsFound
- Type: array
- Description: return value if have which condition invalid
Return Example
{
returnValues: {
objType: {
objectType: "xxxxx",
serviceTag: "yyyyy"
},
objInstanceFull: {
identifiers: {
//identifiers
},
fields: {
//fields
}
},
versionedDataIds: {
// if send fields of versionedData will return versionedDataIds
}
},
status:"complete", // or "error"
errorsFound: []
}
Test Update API Gateway
- Copy invoke URL for get in postman Type: POST
- Body Parameter: not send objectType in parameter , just send “objInstanceFull” and fields want to update
Get EndPoint
Request Parameters
- objectType
- Type: string
- Required: true
- identifiers
- Type: object
- Required: true
Request Example
{
"objectType": "xxxxx",
"identifiers": {
//identifiers
}
}
Output Response
- Identifiers
- Type: object
- fields
- Type: object
- Description: will be return all fields in database
Return Example
{
response: {
identifiers: {
//identifiers
},
fields: {
//fields
}
}
}
Test Get API Gateway
- Copy invoke URL for get in postman Type: FrontEnd use POST or GET
- Body Parameter: just send “identifiers”
