...
POST /totvseai/standardmessage/v1/
...
transactions?batchType={batchType}
Onde batchType indica o tipo de lote
POST /totvseai/standardmessage/v1/transactions?batchType={batchType}
Onde batchType indica o tipo de lote sendo enviado
...
Bloco de código | ||||
---|---|---|---|---|
| ||||
POST /totvseai/standardmessage/v1/transactions?batchType=businessTransaction { "items" : [ { "header" : { "UUID" : "", "type" : "BusinessMessage", "subType" : "event", "transaction" : "customerVendor", "version" : "2.001", "sourceApplication": "", "productName" : "", "productVersion" : "", "generatedOn" : "", "deliveryType" : "async", }, "content" : { "atributo1" : "", "atributo2" : "", ... "atributoN" : "" } },{ "header" : { "UUID" : "", ... "transaction" : "item", "version" : "3.001", ... "deliveryType" : "sync" // Rejeitar toda a requisição e informar que só aceita assíncrono }, "content" : { "atributo1" : "", "atributo2" : "", ... "atributoN" : "" } } ] } |
...
...
POST /totvseai/standardmessage/v1/transactions
O parâmetro batchType não é relevante para esta situação. Logo, se for informado, deve ser ignorado
Não será possível pelo endpoint /transactions. O endpoint /contents existe para esta finalidade.
Se for informado o batchType, ignorar.
Bloco de código | ||
---|---|---|
| ||
POST /totvseai/standardmessage/v1/transactions/ { "header" : { "UUID" : "", "type" : "BusinessMessage", "subType" : "event|request", "transaction" : "customerVendor", "version" : "2.001", "sourceApplication": "", "productName" : "", "productVersion" : "", "companyId" : "", "branchId" : "", "generatedOn" : "", "deliveryType" : "asyncsync", }, "content" : { "atributo1" : "", "atributo2" : "", ... "atributoN" : "" } } |
...
DELETE /totvseai/standardmessage/v1/transacions
Justificando a presença de corpo na requisição de DELETE, é necessário identificar se a transação é síncrona ou não. Sem o corpo, todas as informações teriam que ser colocadas na URL da requisição.
Bloco de código | ||
---|---|---|
| ||
DELETE /totvseai/standardmessage/v1/transactions/ { "header" : { "UUID" : "", "type" : "BusinessMessage", "subType" : "event|request", "transaction" : "customerVendor", "version" : "2.001", "sourceApplication": "", "productName" : "", "productVersion" : "", "companyId" : "", "branchId" : "", "generatedOn" : "", "deliveryType" : "asyncsync", }, "content" : { "atributo1" : "", "atributo2" : "", ... "atributoN" : "" } } |
...
...
language | js |
---|
DELETE /totvseai/standardmessage/v1/transactions
...
?batchType={batchType}
A eliminação em lote utiliza o mesmo endpoint, variando apenas o corpo, onde as mensagens a eliminar estarão dentro de um array JSON. Somente mensagens assíncronas serão aceitas. O endpoint aceita o parâmetro batchType, e o comportamento será o mesmo descrito para quando um lote de mensagens é submetido. Se o parâmetro for omitido, terá valor "simpleBatch".
Bloco de código | ||
---|---|---|
| ||
DELETE /totvseai/standardmessage/v1/transactions
{
"items" : [ |
O JSON equivalente a Response Message será:
Bloco de código | ||
---|---|---|
| ||
{ "header" : { "UUID" : "", "type" : "Response", "subType" : "", "transaction" : "", "version" : "", "sourceApplication" : "", "productName" : "", "productVersion" : "", "generatedOn" : "", "deliveryType": "" }, "content" : { "receivedMessage" : { "UUIDheader" : "<originalMsgUUID>", { "SentByUUID" : "<sourceApplication>", "eventtype" : "upsert|delete" BusinessMessage", }, "processingInformationsubType" : { "event", "processedOntransaction" : "customerVendor", "statusversion" : "OK|ERROR|WARNING2.001", "detailssourceApplication" : ["", { "productName" : "", "codeproductVersion" : "", "messagegeneratedOn" : "", "detailedMessagedeliveryType" : "async", }, "helpUrl" : "http://<serverName>content" : // Opcional { }, "atributo1" : "", { "atributo2" : "", "code" : "", ... "messageatributoN" : "", } "detailedMessage" : ""}, { "helpUrlheader" : "http://<serverName>" { // Opcional } ]"UUID" : "", }, "returnContenttype" : {"BusinessMessage", "atributo1subType" : "event", "atributo2transaction" : "customerVendor", "listOfInternalIDversion" : [ "2.001", // Opcional em caso de resposta de requests "sourceApplication": "", { "productName" : "", "nameproductVersion" : "InternalIdName", "origingeneratedOn" : "", "destinationdeliveryType" : "async", }, }, "content" : { { "atributo1" : "", "nameatributo2" : "InternalIdName", ... "originatributoN" : "", } "destination"} : "" } ] } } } |
As requisições deste endpoint são exclusivamente síncronas.
...
]
}
|
GET /totvseai/standardmessage/v1/contents/{transactionID_version}?page={page}&pageSize={pageSize}&order={orderList}&fields={fieldList}&{field1}={value1}&{field2}={value2}&{fieldN}={valueN}
Onde:
Bloco de código | ||
---|---|---|
| ||
// Permitir também os filtros por atributo GET /totvseai/standardmessage/v1/contents/customervendor_1_000?page={page}&pageSize={pageSize}&order={campos} { "hasNext" : "true", "items" : [ { "atributo1" : "", "atributo2" : "" }, { "atributo1" : "", "atributo2" : "" } ] } |
...
O termo entidade está sendo usado no lugar de mensagem, porque neste endpoint (e nos demais) não haverá os controles que são feitos no endpoint /transactions. Uma mensagem implica em um remetente, um destinatário e um conteúdo. Neste caso, temos explicito apenas o conteúdo, correspondente a uma entidade no destino, que é identificada pelo internalID.
...