Hyperledger Composer REST API appears a "transactionId": "string" - hyperledger-composer

I have this issue when connecting the browser to the REST API in Hyperledger Composer. It appears a new field when trying to post a tarnsaction, called "transactionId": "string" and "timestamp2:
{
"$class": "org.cryptolab.economiassociales.AnadirNodo",
"idNodo": "string",
"nombre": "string",
"localizacion": "string",
"delegada": "string",
"numeroMiembrosParticipantes": 0,
"transactionId": "string",
"timestamp": "2019-03-18T15:55:40.857Z"
}
trying to fill the transactionId string, the transaction fails with 422 error code:
{
"error": {
"statusCode": 422,
"name": "ValidationError",
"message": "The `AnadirNodo` instance is not valid. Details: `transactionId` can't be set (value: \"s1\").",
"details": {
"context": "AnadirNodo",
"codes": {
"transactionId": [
"absence"
]
},
"messages": {
"transactionId": [
"can't be set"
]
}
},
"stack": "ValidationError: The `AnadirNodo` instance is not valid. Details: `transactionId` can't be set (value: \"s1\").\n at /home/hyperledger/.nvm/versions/node/v8.15.1/lib/node_modules/composer-rest-server/node_modules/loopback-datasource-juggler/lib/dao.js:400:12\n at AnadirNodo.<anonymous> (/home/hyperledger/.nvm/versions/node/v8.15.1/lib/node_modules/composer-rest-server/node_modules/loopback-datasource-juggler/lib/validations.js:578:11)\n at AnadirNodo.next (/home/hyperledger/.nvm/versions/node/v8.15.1/lib/node_modules/composer-rest-server/node_modules/loopback-datasource-juggler/lib/hooks.js:93:12)\n at AnadirNodo.<anonymous> (/home/hyperledger/.nvm/versions/node/v8.15.1/lib/node_modules/composer-rest-server/node_modules/loopback-datasource-juggler/lib/validations.js:575:23)\n at AnadirNodo.trigger (/home/hyperledger/.nvm/versions/node/v8.15.1/lib/node_modules/composer-rest-server/node_modules/loopback-datasource-juggler/lib/hooks.js:83:12)\n at AnadirNodo.Validatable.isValid (/home/hyperledger/.nvm/versions/node/v8.15.1/lib/node_modules/composer-rest-server/node_modules/loopback-datasource-juggler/lib/validations.js:541:8)\n at /home/hyperledger/.nvm/versions/node/v8.15.1/lib/node_modules/composer-rest-server/node_modules/loopback-datasource-juggler/lib/dao.js:396:9\n at doNotify (/home/hyperledger/.nvm/versions/node/v8.15.1/lib/node_modules/composer-rest-server/node_modules/loopback-datasource-juggler/lib/observer.js:155:49)\n at doNotify (/home/hyperledger/.nvm/versions/node/v8.15.1/lib/node_modules/composer-rest-server/node_modules/loopback-datasource-juggler/lib/observer.js:155:49)\n at doNotify (/home/hyperledger/.nvm/versions/node/v8.15.1/lib/node_modules/composer-rest-server/node_modules/loopback-datasource-juggler/lib/observer.js:155:49)\n at doNotify (/home/hyperledger/.nvm/versions/node/v8.15.1/lib/node_modules/composer-rest-server/node_modules/loopback-datasource-juggler/lib/observer.js:155:49)\n at Function.ObserverMixin._notifyBaseObservers (/home/hyperledger/.nvm/versions/node/v8.15.1/lib/node_modules/composer-rest-server/node_modules/loopback-datasource-juggler/lib/observer.js:178:5)\n at Function.ObserverMixin.notifyObserversOf (/home/hyperledger/.nvm/versions/node/v8.15.1/lib/node_modules/composer-rest-server/node_modules/loopback-datasource-juggler/lib/observer.js:153:8)\n at Function.ObserverMixin._notifyBaseObservers (/home/hyperledger/.nvm/versions/node/v8.15.1/lib/node_modules/composer-rest-server/node_modules/loopback-datasource-juggler/lib/observer.js:176:15)\n at Function.ObserverMixin.notifyObserversOf (/home/hyperledger/.nvm/versions/node/v8.15.1/lib/node_modules/composer-rest-server/node_modules/loopback-datasource-juggler/lib/observer.js:153:8)\n at Function.ObserverMixin._notifyBaseObservers (/home/hyperledger/.nvm/versions/node/v8.15.1/lib/node_modules/composer-rest-server/node_modules/loopback-datasource-juggler/lib/observer.js:176:15)"
}
}
It seems similar to this topic:
transactionId when submitting a transaction
What can I do? it is frustrating...
Thanks!

See the Post Answer. Post your transaction as follows:
{
"$class": "org.cryptolab.economiassociales.AnadirNodo",
"idNodo": "string",
"nombre": "string",
"localizacion": "string",
"delegada": "string",
"numeroMiembrosParticipantes": 0
}
Hope it will help you :)

Related

Alexa.Discovery response: no device detected by Alexa

I am implementing my Alexa Home Skill using AWS Lambda.
Given the following request I receive when I try to detect new devices on Alexa Skil test page:
{directive={header={namespace=Alexa.Discovery, name=Discover, payloadVersion=3, messageId=0160c7e7-031f-47ee-a1d9-a23f38f87a9e}, payload={scope={type=BearerToken, token=...}}}}
I respond with the following:
{
"event": {
"payload": {
"endpoints": [
{
"displayCategories": [
"SMARTPLUG"
],
"capabilities": [
{
"type": "AlexaInterface",
"interface": "Alexa",
"version": "3"
},
{
"type": "AlexaInterface",
"interface": "Alexa.PowerController",
"version": "3",
"properties": {
"retrievable": true,
"supported": [
{
"name": "powerState"
}
],
"proactivelyReported": true
}
},
{
"type": "AlexaInterface",
"interface": "Alexa.EndpointHealth",
"version": "3",
"properties": {
"retrievable": true,
"supported": [
{
"name": "connectivity"
}
],
"proactivelyReported": true
}
}
],
"manufacturerName": "mirko.io",
"endpointId": "ca84ef6d-53b1-430a-8a5e-a62f174eac5e",
"description": "mirko.io forno (id: ca84ef6d-53b1-430a-8a5e-a62f174eac5e)",
"friendlyName": "forno"
}
]
},
"header": {
"payloadVersion": "3",
"namespace": "Alexa.Discovery",
"name": "Discover.Response",
"messageId": "c0555cc8-ad7a-4377-b310-9de9b9ab6282"
}
}
}
Despite that, for some reasons Alexa answers that it did not find any new device.
I may be mistaken but I am pretty sure it used to work before I decided to add the Alexa.EndpointHealth interface.
Your response object looks right to me, except the extra "endpoint" field.
"endpoint": {
"endpointId": "INVALID",
"scope": {
"type": "BearerToken",
"token": "INVALID"
}
}
There's no such field in the Alexa.Discovery documentation. Try removing it and see if it resolves the issue.

Asymmetrik FHIR Server Core support FHIRCast?

I have established a "subscription" to updates on a specific "Bundle". For some reason, the web hook is not firing. Is FHIRCast supported on Asymmetrik's FHIR Server? Here is my "subscription" json payload:
{
"resourceType" : "Subscription",
"status" : "active",
"contact": [
{
"relationship": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0131",
"code": "N"
}
]
}
],
"name": {
"family": "du Marché",
"_family": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/humanname-own-prefix",
"valueString": "VV"
}
]
},
"given": [
"Bénédicte"
]
},
"telecom": [
{
"system": "phone",
"value": "+33 (237) 998327"
}
],
"address": {
"use": "home",
"type": "both",
"line": [
"534 Erewhon St"
],
"city": "PleasantVille",
"district": "Rainbow",
"state": "Vic",
"postalCode": "3999",
"period": {
"start": "1974-12-25"
}
},
"gender": "female",
"period": {
"start": "2012"
}
}
],
"end" : "2021-02-07T13:28:17.239+02:00",
"reason" : "FHIR web hook",
"criteria" : "Bundle/af03af555d9eb78229619cfeac8767409fd22f72",
"error" : "error note",
"channel" : {
"type" : "rest-hook",
"endpoint" : "https://localhost:5001/api/FHIRNotification",
"payload" : "application/fhir+json",
"header" : [""]
}
}
Perhaps I am missing an implementation step to add the subscription web hook functionality?
Thanks for the help!
Todd
Currently we do not support FHIRCast out of the box since this is a facade server. To get FHIRCast working properly you would also probably need triggers or something else setup on the database.
Im not super familiar with FHIRCast personally but it does seem like there is some connection to a hub separate of the FHIR server as well.

Create Google Tag manager Trigger that fires when {{variable}} == 'false' with GTM API v2

I am trying to create a Google Tag Manager trigger using the GTM API v2.
I'm trying to achieve the following:
I want a trigger to fire on Page view in pages where the variable Mobile or not is false
I tried to call the API with these parameters
{
"name": "Desktop Users Test",
"type": "pageview",
"filter": [
{
"parameter": [
{
"type": "template",
"value": "{{ Mobile or not }}",
"key": "arg0"
},
{
"type": "boolean",
"value": "false",
"key": "arg1"
}
],
"type": "equals"
}
]
}
But it returning a 400 Bad Request error with this response:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalidArgument",
"message": "Unable to parse trigger data"
}
],
"code": 400,
"message": "Unable to parse trigger data"
}
}
If I create a trigger with only name, type and empty filters it works
{
"name": "Will work too",
"type": "pageview",
"filter": []
}
// will return a "200 OK" response
Please, what are the right parameters to create this trigger?

swagger: how to validate formData

So far I'm able to do swagger validation if the parameters are from "in": "body" or if the input expected is in a json format.
However, I can't find how to validate a simple string entered as formData.
Below is my swagger script (in json format)
v1swag = {
"cancels_post": {
"tags": ["/api/v1"],
"parameters": [
{
"name": "token",
"in": "formData",
"type": "string",
"required": True,
"description": "Cancels the provided token.",
}
],
"responses": {
"200": {
"description": "Success!",
}
}
}
}
I removed the schema as it seems to only work for "in": "body"
I've been searching the net but can't seem to find the light.
Though I will still be searching... Any hints would be greatly appreciated.
Thank you very much in advance.
A different source media type has to be consumed here. Specify "consumes" member to include media type of application/x-www-form-urlencoded.
v1swag = {
"cancels_post": {
"tags": ["/api/v1"],
"consumes": [
"application/x-www-form-urlencoded"
],
"parameters": [
{
"name": "token",
"in": "formData",
"type": "string",
"required": True,
"description": "Cancels the provided token.",
}
],
"responses": {
"200": {
"description": "Success!",
}
}
}
}

IBM Social Business Toolkit getContacts API Fails With 403 Forbidden

I used to be able to use the IBM SBT getContacts API from either a perl script (with authentication provided in the request) or an internet browser (authentication popup would appear) and it would return the data in JSON format as documented on the IBM Connections Developers API reference page:
http://www-10.lotus.com/ldd/appdevwiki.nsf/xpAPIViewer.xsp?lookupName=API+Reference#action=openDocument&res_title=Contacts_getContacts_API&content=apicontent&sa=true
Recently, however, the API call has been returning a 403 forbidden status. If I sign in to the IBM Connections Cloud before trying to use the API via a browser, it is converted to:
https://apps.na.collabserv.com/mycontacts/home.html
Does anyone know what I need to do to get the API to work again?
Thanks.
The best API to use are
https://apps.na.collabserv.com/lotuslive-shindig-server/social/rest/people/#me/#all?filterBy=type&filterOp=equals&filterValue=contacts&format=json
You'll get a list of the following entries back...
{
"photos":
[
],
"telephone": "",
"profileUrl": "",
"mobilephone": "",
"orgs":
[
{
"value": "CONTACTS",
"type": "Source"
},
{
"value": "Mentorship Expressway",
"type": "Org"
}
],
"website": "",
"id": "na.collabserv.com:contact:160000909070",
"fax": "",
"connectedToId": 201238541234,
"addresses":
[
],
"emailAddress": "asdfasdf#us.ibm.com",
"websites":
[
],
"objectId": 160000909070,
"type": "FRIEND",
"jobtitle": "",
"updated": "2014-07-01T16:44:21.000Z",
"ims":
[
],
"emails":
[
{
"value": "CONTACTS",
"type": "Source"
},
{
"title": "Primary Email",
"email": "asdfasdf#us.ibm.com"
}
],
"org":
{
"name": "Mentorship Expressway"
},
"displayName": "asdfasdf",
"address": "",
"companyId": 22285,
"phoneNumbers":
[
{
"value": "CONTACTS",
"type": "Source"
},
{
"title": "MOBILE",
"phone": "+ asdfasdf"
}
]
}

Resources