I'm evaluating atlassian-connect-express and just created an app
boilerplate with "atlassian-connect new", and then deployed it via ngrok
to my Jira dev account.
That works fine, but when I try to use the file "credentials.json" with
my account data, the plug starts with the error message:
Failed to register with host https‍://michael%40...:[My
password]#connect-ace.atlassian.net (401)
Add-on not registered; no compatible hosts detected
I get a similar message when I go to the url connect-ace.atlassian.net
Here my atlassian-connect.json
{
"key": "my-add-on",
"name": "Ping Pong",
"description": "My very first add-on",
"vendor": {
"name": "Angry Nerds",
"url": "https://www.atlassian.com/angrynerds"
},
"baseUrl": "https://xxxxxxx.ngrok.io",
"links": {
"self": "https://xxxxxxxx.ngrok.io/atlassian-connect.json",
"homepage": "https://xxxxxxx.ngrok.io/atlassian-connect.json"
},
"authentication": {
"type": "jwt"
},
"lifecycle": {
"installed": "/installed"
},
"scopes": [
"READ"
],
"modules": {
"generalPages": [
{
"key": "hello-world-page-jira",
"location": "system.top.navigation.bar",
"name": {
"value": "Hello World"
},
"url": "/hello-world",
"conditions": [{
"condition": "user_is_logged_in"
}]
},
{
"key": "hello-world-page-confluence",
"location": "system.header/left",
"name": {
"value": "Hello World"
},
"url": "/hello-world",
"conditions": [{
"condition": "user_is_logged_in"
}]
}
]
}
}
and my credatials.json
{
"hosts": {
"connect-ace.atlassian.net": {
"product": "jira",
"username": "michael#---",
"password": "---password---"
}
}
}
How can I get my dev account working with connect-ace?
Two things to check:
1 - Check the if the credentials.json has correct values. host url should start with https://. Password is the api token generated from here.
{
"hosts": {
"https://<your atlassian site name>.atlassian.net": {
"product": "jira",
"username": "<jira user name>",
"password": "<Token created from https://id.atlassian.com/manage/api-tokens>"
}
}
}
2- Enable development mode at Settings -> Apps -> Manage Apps -> Settings. (This is required if the app is not published in marketplace)
This error is a default from atlas-connect
Print error image
In atlasssian-connect.json
replace this :
"lifecycle": {
"installed": "/installed"
},
for this:
"lifecycle": {
"installed": "installed"
},
Have you tried spawning your own cloud instance and testing it there? If not yet, try creating one here. Once successfully registered, in your credentials.json, change "connect-ace" with your baseUrl/sitename and with the right credentials, it should automatically install it for you.
Related
I am trying to implement Local Fulfillment in my Google Smart Home Action.
some of my devices have 2 channels (dual relay switch).
Dual channel device is shown in Google Home app as two separate devices(light-test123123_0 and light-test123123_1) and it works just fine.
I have added customData and otherDevicesIds to my SYNC response to enable local fultilment and built an local app using #google/local-home-sdk. Google Home identifies Single channel devices and sends commands locally.
example of SYNC response body:
{
"response": {
"payload": {
"devices": [
{
"traits": [
"action.devices.traits.OnOff",
"action.devices.traits.Brightness"
],
"customData": {
"path": "/local-fulfil/0/",
"port": 3000
},
"name": {
"name": "light",
"nicknames": [
"light"
],
"defaultNames": [
"light"
]
},
"id": "light-test123123_0",
"type": "action.devices.types.LIGHT",
"deviceInfo": {
"hwVersion": "LIGHT",
"model": "LIGHT",
"swVersion": "1.0",
"manufacturer": "MANUFATURER"
},
"attributes": {},
"willReportState": false,
"otherDeviceIds": [
{
"deviceId": "light-test123123_0"
},
{
"deviceId": "light-test123123"
}
]
},
{
"name": {
"nicknames": [
"light"
],
"defaultNames": [
"light"
],
"name": "light"
},
"deviceInfo": {
"swVersion": "1.0",
"hwVersion": "LIGHT",
"manufacturer": "MANUFATURER",
"model": "LIGHT"
},
"attributes": {},
"otherDeviceIds": [
{
"deviceId": "light-test123123_1"
},
{
"deviceId": "light-test123123"
}
],
"willReportState": false,
"traits": [
"action.devices.traits.OnOff",
"action.devices.traits.Brightness"
],
"id": "light-test123123_1",
"customData": {
"port": 3000,
"path": "/local-fulfil/1/"
},
"type": "action.devices.types.LIGHT"
}
],
"agentUserId": "RuRHIPWpD5W23iGiU81A5PoTKqB2"
},
"requestId": "16772679358918515269"
}
}
The problems appeared when I have started the local SDK implementation because even if my dual channel device sends 2 separate UDP packets with different IDs mentioned above. Google ignores one of them. Looks like it is not possible to have 2 devices with same IP address.
Here is the IDENTIFY request body:
{
"requestId": "88DB84992F074FF0B408D8383CF198C4",
"inputs": [
{
"intent": "action.devices.IDENTIFY",
"payload": {
"device": {
"udpScanData": {
"data": "6C696768742D6475616C2D3132335F30"
}
},
"structureData": {}
}
}
],
"devices": [
{
"id": "light-dual-123_0",
"customData": {
"path": "/local-fulfil/0/",
"port": 3000
}
},
{
"id": "light-dual-123_1",
"customData": {
"path": "/local-fulfil/1/",
"port": 3000
}
}
]
}
and response:
{
"intent": "action.devices.IDENTIFY",
"requestId": "88DB84992F074FF0B408D8383CF198C4",
"payload": {
"device": {
"id": "",
"verificationId": "light-test123123_0"
}
}
}
I have written a basic app that sends UDP broadcast and it outputs the next data:
sent broadcast packet
192.168.1.235:8888 sent this: light-test123123_0
192.168.1.235:8888 sent this: light-test123123_1
That shows how my device acts when it receives a broadcast packet.
Is there a way to fix this?
The Local Fulfillment platform currently (as of Local Home SDK 1.4) uniquely identify the device by their network address, so it won't be able to handle multiple broadcast response coming from the same physical connected device.
You can however have one device acting as a proxy for multiple end-devices, this is done by:
returning setting the isProxy flag to true in the IDENTIFY response:
https://developers.google.com/assistant/smarthome/develop/local#hub-identify
handling the REACHABLE_DEVICES intent to return all the end-device verificationId:
https://developers.google.com/assistant/smarthome/develop/local#hub-identify
The Local Home SDK sample includes a virtual device that can be run in this configuration:
https://github.com/actions-on-google/smart-home-local#set-up-the-virtual-device
We are operating a TFS 2018 Update 2 in our enviroment.
We are sending the example json found here to our server and it is getting accepted successfully:
{
"properties": {
"sampleId": 7,
"customInfo": "Custom status information",
"startedDateTime": {
"$type": "System.DateTime",
"$value": "2017-09-19T14:50:26.7410146Z"
},
"weight": {
"$type": "System.Double",
"$value": 1.75
},
"bytes": {
"$type": "System.Byte[]",
"$value": "dGhpcyBpcyBzYW1wbGUgYmFzZTY0IGVuY29kZWQgc3RyaW5n"
},
"globalId": {
"$type": "System.Guid",
"$value": "1e788cb9-9d3d-4dc6-ac05-822092d17f90"
}
},
"state": "succeeded",
"description": "Sample status succeeded",
"context": {
"name": "sample-status-1",
"genre": "vsts-samples"
},
"targetUrl": "http://fabrikam-fiber-inc.com/CI/builds/1"
}
But the response doesn't look like in the documentation. Instead it looks like this:
{
"id": 6,
"state": "succeeded",
"description": "Sample status succeeded",
"context": {
"name": "sample-status-1",
"genre": "vsts-samples"
},
"creationDate": "2019-12-11T16:14:05.0574648Z",
"updatedDate": "2019-12-11T16:14:05.0574648Z",
"createdBy": {
"displayName": "...",
"url": "https://.../_apis/Identities/0b85e078-130d-4cb8-a450-17c5c7efccec",
"_links": {
"avatar": {
"href": "https://.../_api/_common/identityImage?id=0b85e078-130d-4cb8-a450-17c5c7efccec"
}
},
"id": "0b85e078-130d-4cb8-a450-17c5c7efccec",
"uniqueName": "...",
"imageUrl": "https://.../_api/_common/identityImage?id=0b85e078-130d-4cb8-a450-17c5c7efccec"
},
"targetUrl": "http://fabrikam-fiber-inc.com/CI/builds/1",
"_links": {
"self": {
"href": "https://.../_apis/git/repositories/35fe73eb-7af1-4bba-bf04-545611fcac1d/pullRequests/58/statuses/6"
},
"repository": {
"href": "https://.../_apis/git/repositories/35fe73eb-7af1-4bba-bf04-545611fcac1d"
}
}
}
The properties are gone. What could be wrong?
Could it be a somehow completely missleading documentation?
To troubleshoot your issue, please check the following items:
Check whether the Status updated on the pull request after running the POST request.
Press F12 in your browser, and send the POST request to check the statuses to see whether you can get properties in the response body.
Check your TFS edition by going to Administration Console -- Application Tier, or checking the About on the web portal. The issue can not be reproduced in TFS 2018.2 on our side.
Is there any possibility for conversion from dwg to dgn using forge design automation api? If yes then what will be the best way to do that? Any suggestion would be helpful.
Yes, you can use the -DGNEXPORT command in your script to accomplish this.
I was trying to get a concrete codes for this question as it requires some tricks and support of seed file on Design Automation. By engineer team's help, now it is working.
Assume we test with Postman. If you are working with v2 of Design Automation, the scripts below demo the usage.
Activity:
{
"HostApplication": "",
"RequiredEngineVersion": "23.1",
"Parameters": {
"InputParameters": [{
"Name": "HostDwg",
"LocalFileName": "$(HostDwg)"
}],
"OutputParameters": [{
"Name": "Result",
"LocalFileName": "result.dgn"
}]
},
"Instruction": {
"CommandLineParameters": null,
"Script":"(command \"_-DGNEXPORT\" \"_V8\" (strcat (getvar \"DWGPREFIX\")
\"result.dgn\") \"_Master\" \"Standard\" (strcat (getvar \"LOCALROOTPREFIX\")
\"Template\\\\V8-Imperial-Seed3D.dgn\"))\n"
},
"Version": 1,
"Id": "CreateActByLISP"
}
WorkItem:
{
"#odata.type": "#ACES.Models.WorkItem",
"Arguments": {
"InputArguments": [
{
"Resource": "http://forge-test.oss-cn-shanghai.aliyuncs.com/test.dwg",
"Name": "HostDwg",
"StorageProvider": "Generic"
}
],
"OutputArguments": [
{
"Name": "Result",
"StorageProvider": "Generic",
"HttpVerb": "POST",
"Resource": null
}
]
},
"ActivityId": "CreateActByLISP",
"Id": ""
}
If working with v3 of Design Automation, the script would be as below. Note: the engine needs 23.1 (Autodesk.AutoCAD+23_1)
Activity
{
"commandLine": [
"$(engine.path)\\accoreconsole.exe /i $(args[HostDwg].path) /s $(settings[script].path)"
],
"parameters": {
"HostDwg": {
"verb": "get",
"description": "Host drawing to be loaded into acad.",
"localName": "$(HostDwg)"
},
"Result": {
"verb": "post",
"description": "Results",
"localName": "result.dgn"
}
},
"engine": "Autodesk.AutoCAD+23_1",
"appbundles": [],
"settings": {
"script": {
"value": "(command \"_-DGNEXPORT\" \"_V8\" (strcat (getvar \"DWGPREFIX\") \"result.dgn\") \"_Master\" \"Standard\" (strcat (getvar \"LOCALROOTPREFIX\") \"Template\\\\V8-Imperial-Seed3D.dgn\"))\n"
}
},
"description": "PlotToPdf for all layouts.",
"id": "myexportdgn"
}
WorkItem:
{
"activityId": "{{your nick name}}.myexportdgn+{{activity alias}}",
"arguments": {
"HostDwg": {
"url": "http://forge-test.oss-cn-shanghai.aliyuncs.com/test.dwg"
},
"Result": {
"verb": "put",
"url": "<your upload url>"
}
}
}
I am developing a solution for a product and trying to implement C2C connection. I am in stuck with linking SmartThings with my backend via OAuth.
I get request
{
"lifecycle": "CONFIGURATION",
"executionId": "41d224ba-7de3-77ac-fe87-a56fa6f325c3",
"locale": "en",
"version": "0.1.0",
"client": {
"os": "ios",
"version": "1.6.17",
"language": "uk"
},
"configurationData": {
"installedAppId": "7393625f-64d5-42cb-a52f-7935a677c4bb",
"phase": "PAGE",
"pageId": "linkPage",
"previousPageId": "",
"config": {}
},
"settings": {}
}
And return response, that is rendered in SmartThings App:
{
"configurationData": {
"page": {
"pageId": "linkPage",
"nextPageId": "",
"previousPageId": "",
"complete": true,
"name": "Account Linking",
"sections": [ {
"name": "Please, link SmartThings to your XXXXXX account",
"settings": [ {
"id": "linkAccount",
"name": "Link Account",
"type": "OAUTH",
"required": true,
"urlTemplate": "https://xxxxxx.auth.us-east-2.amazoncognito.com/login?response_type=code&client_id=20kucf9dcg5ju9deqeppugqft1&state=7393625f-64d5-42cb-a52f-7935a677c4bb&redirect_uri=https%3A%2F%2Fapi.smartthings.com%2Foauth%2Fcallback"
} ]
} ]
}
}
}
Authentication passes successfully and returns code to callback like that:
https://api.smartthings.com/oauth/callback?code=9dfea1ca-54e8-47e8-ba90-24f20068ad2b&state=7393625f-64d5-42cb-a52f-7935a677c4bb
But the callback returns HTTP 401.
I've read this topic https://community.smartthings.com/t/cloud-to-cloud-oauth-rest-api/118902 and did not find a solution. No more helpful info I could found on the Web.
Has anybody implemented this with success?
The Support is awful - no response for several days.. From my previous Support contacting experience - they can respond after several weeks...
Thank you!
This is a bug of iOS SmartThings application, Android works fine.
https://community.smartthings.com/t/cant-implement-oauth-for-cloud-to-cloud/143258/7
I am using Swagger-ui version 3.0.2, I have hosted it locally and provided it my Json file and API it opens the document fine and lists all the method in the json file, after i put basic authentication in it, i did changes in the .JSON file, but there are some methods which i want to mark anonymous.
{
"swagger": "2.0",
"info": {
"description": "description",
"version": "1.0",
"title": "API"
},
"host": "localhost",
"schemes": [
"http"
],
"securityDefinitions": {
"anonymous_auth": {
"type": ""
},
"basic_auth": {
"type": "basic",
"name": "basic_auth",
"description": "Basic Authentication"
},
"token": {
"type": "apiKey",
"description": "API Token Authentication",
"name": "apikey",
"in": "header"
}
},
"security": [
{
"basic_auth": [ ]
},
{
"token": [ ]
}
],
"paths": {
//somthing
},
"definitions": {
//something
}
}
By using security atribute in this way it will secure complete file, but i have some methods which should be anonymous.
To remove global security, add an empty security array to the operation:
"paths": {
"/something:": {
"get": {
"security": [],
...
}
}
}
Also, your spec is not valid:
Remove anonymous_auth.
Remove name from basic_auth - name is only used in apiKey security schemes to specify the name of the header or query parameter that will contain the API key.