# Kyvis Labs API Client Module

**URL:** <https://forum.inductiveautomation.com/t/kyvis-labs-api-client-module/69120>\
**Category:** 3rd Party Modules\
**Created:** [January 28, 2023, 1:14am UTC](https://forum.inductiveautomation.com/t/kyvis-labs-api-client-module/69120 "2023-01-28T01:14:50Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![kyvislabs](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kyvislabs/32/26325_2.png) [@kyvislabs](https://forum.inductiveautomation.com/u/kyvislabs)\
**Post date:** [February 27, 2023, 7:59pm UTC](https://forum.inductiveautomation.com/t/kyvis-labs-api-client-module/69120/21 "2023-02-27T19:59:14Z")

</div>

The module stores the image on the server and provides a URL as a tag you can use:

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/7/7775f341c28e1774dca55fdc57a8315a065c809a.png)

Use that image directly in the image component in Perspective or Vision.

---

<div class="post-metadata">

**Author:** ![tpile](https://avatars.discourse-cdn.com/v4/letter/t/e274bd/32.png) [@tpile](https://forum.inductiveautomation.com/u/tpile)\
**Post date:** [February 28, 2023, 7:49pm UTC](https://forum.inductiveautomation.com/t/kyvis-labs-api-client-module/69120/22 "2023-02-28T19:49:45Z")

</div>

Thanks for your previous response. I am now trying to connect to my unifi network cloud key controller. I am using unifi\_network example YAML. My cloud key does not have a certificate so when I connect with Firefox I get a certificate error. I have entered my user name, password and URL into the variables. Both functions are getting the error "com.kyvislabs.api.client.common.exceptions.APIException: SessionAuth: Failed login". I also have the unified controller software running on a raspberry PI and I get the same error. I have verified my username and password by logging in to the controllers with FireFox. Am I required to have a certificate installed for your API to work?  
Thanks

---

<div class="post-metadata">

**Author:** ![kyvislabs](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kyvislabs/32/26325_2.png) [@kyvislabs](https://forum.inductiveautomation.com/u/kyvislabs)\
**Post date:** [March 2, 2023, 5:54pm UTC](https://forum.inductiveautomation.com/t/kyvis-labs-api-client-module/69120/23 "2023-03-02T17:54:08Z")

</div>

Not if the following is in your YAML configuration:

```auto
httpsVerification: false

```

Do you have that?

---

<div class="post-metadata">

**Author:** ![tpile](https://avatars.discourse-cdn.com/v4/letter/t/e274bd/32.png) [@tpile](https://forum.inductiveautomation.com/u/tpile)\
**Post date:** [March 2, 2023, 7:02pm UTC](https://forum.inductiveautomation.com/t/kyvis-labs-api-client-module/69120/24 "2023-03-02T19:02:55Z")

</div>

Yes. I am using your example from GitHub.  
Thanks,  
Tom

---

<div class="post-metadata">

**Author:** ![kyvislabs](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kyvislabs/32/26325_2.png) [@kyvislabs](https://forum.inductiveautomation.com/u/kyvislabs)\
**Post date:** [March 2, 2023, 9:11pm UTC](https://forum.inductiveautomation.com/t/kyvis-labs-api-client-module/69120/25 "2023-03-02T21:11:19Z")

</div>

Ok, so you will need to turn on the logger for your API. Go into the status page of the Gateway and select the Logs on the left. Click on the settings button and enter in the name of your API "unifi". Turn on the top most logger to "TRACE" and try it again. Hopefully we can see the reason why it is failing from the logs.

---

<div class="post-metadata">

**Author:** ![tpile](https://avatars.discourse-cdn.com/v4/letter/t/e274bd/32.png) [@tpile](https://forum.inductiveautomation.com/u/tpile)\
**Post date:** [March 2, 2023, 10:23pm UTC](https://forum.inductiveautomation.com/t/kyvis-labs-api-client-module/69120/26 "2023-03-02T22:23:33Z")

</div>

Below is what I saw. I verified the username and password but removed from info below. I also removed my IP address but is correct.  
Hope this helps  
Tom

| SessionAuth | 02Mar2023 17:16:26 |
| --- | --- |
| | Failed authentication (401): {meta:{rc:error,msg:api.err.LoginRequired},data:} |
| SessionAuth | 02Mar2023 17:16:26 |
| | Failed authentication (401): {meta:{rc:error,msg:api.err.LoginRequired},data:} |
| SessionAuth | 02Mar2023 17:16:26 |
| | Unifi request [method=POST, url=[https://XXX.XXX.XXX:8443/api/auth/login](https://XXX.XXX.XXX:8443/api/auth/login), headers=none, params=none, body={username= **, password=** \*\*, remember=true}] |
| SessionAuth | 02Mar2023 17:16:26 |
| | Unifi request [method=POST, url=[https://xxx.xxx.xxx.xxx:8443/api/auth/login](https://xxx.xxx.xxx.xxx:8443/api/auth/login), headers=none, params=none, body={username=\*\*\*\*, password=\*\*\*\*\*\*\*\*, remember=true}] |

---

<div class="post-metadata">

**Author:** ![kyvislabs](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kyvislabs/32/26325_2.png) [@kyvislabs](https://forum.inductiveautomation.com/u/kyvislabs)\
**Post date:** [March 3, 2023, 1:05am UTC](https://forum.inductiveautomation.com/t/kyvis-labs-api-client-module/69120/27 "2023-03-03T01:05:32Z")

</div>

It looks like authentication is failing. Maybe double check your credentials?

---

<div class="post-metadata">

**Author:** ![tpile](https://avatars.discourse-cdn.com/v4/letter/t/e274bd/32.png) [@tpile](https://forum.inductiveautomation.com/u/tpile)\
**Post date:** [March 3, 2023, 9:13pm UTC](https://forum.inductiveautomation.com/t/kyvis-labs-api-client-module/69120/28 "2023-03-03T21:13:29Z")

</div>

I opened a browser to my [https://xxx.xxx.xxx.xxx:8443](https://xxx.xxx.xxx.xxx:8443) which I pasted directly from the SessionAuth in the log. This brought up the Unifi Login Menu. I copied the username and password from the SessionAuth log. I was successfully logged into the CloudKey controller which is running version 7.2.92. I then used Postman to test login. I found that I had to use [https://xxx.xxx.xxx.xxx:8443/api/login](https://xxx.xxx.xxx.xxx:8443/api/login) with body of {"username":"dummy","password":"dummy","remember":"true"} to get logged in. I don't know if Postman is different but the format but this doesn't match what was in the log file for SessionAuth. When I used /api/auth/login in Postman, I got the message.  
{  
"meta": {  
"rc": "error",  
"msg": "api.err.NoSiteContext"  
},  
"data":   
}

I changed the yaml file to use /api/login and now get the following error.

| SessionAuth | 03Mar2023 16:10:48 |
| --- | --- |
| | Failed authentication (500): \<!doctype html\>HTTP Status 500 – Internal Server Errorbody {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}
# HTTP Status 500 – Internal Server Error
 |

Hopefully this information might help.  
Thanks,  
Tom

---

<div class="post-metadata">

**Author:** ![kyvislabs](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kyvislabs/32/26325_2.png) [@kyvislabs](https://forum.inductiveautomation.com/u/kyvislabs)\
**Post date:** [March 3, 2023, 9:33pm UTC](https://forum.inductiveautomation.com/t/kyvis-labs-api-client-module/69120/29 "2023-03-03T21:33:13Z")

</div>

Which controller are you using? If I remember correctly, there is a difference in the paths if you are using older cloud keys vs the newer one vs the UDM stuff.

---

<div class="post-metadata">

**Author:** ![tpile](https://avatars.discourse-cdn.com/v4/letter/t/e274bd/32.png) [@tpile](https://forum.inductiveautomation.com/u/tpile)\
**Post date:** [March 3, 2023, 10:12pm UTC](https://forum.inductiveautomation.com/t/kyvis-labs-api-client-module/69120/30 "2023-03-03T22:12:29Z")

</div>

I am using an older Cloudkey(G1) and I am also running the cloud controller software on a RaspberryPI and it seems to use the same API calls as my CloudKey. I have also found I had to remove /proxy/network from both the clients and devices function in Postman to get them to work.  
Tom

---

<div class="post-metadata">

**Author:** ![WChester](https://avatars.discourse-cdn.com/v4/letter/w/df788c/32.png) [@WChester](https://forum.inductiveautomation.com/u/WChester)\
**Post date:** [May 13, 2023, 5:14pm UTC](https://forum.inductiveautomation.com/t/kyvis-labs-api-client-module/69120/31 "2023-05-13T17:14:02Z")

</div>

Hi. I had a question. I am going to attempt to integrate an OpenSprinkler system into this module and had a couple of questions.

1. The API required a password as part of the URL and requires the password to be an MD5 hash. Is that supported?
2. If I wanted to change that password is that supported with in the module?

---

<div class="post-metadata">

**Author:** ![Joshua\_Dingus](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@Joshua\_Dingus](https://forum.inductiveautomation.com/u/Joshua_Dingus)\
**Post date:** [October 15, 2023, 1:14pm UTC](https://forum.inductiveautomation.com/t/kyvis-labs-api-client-module/69120/32 "2023-10-15T13:14:07Z")

</div>

This module looks very promising. Definitely going to try it out.

Im looking for a solution that could allow Ignition to authenticate 3rd party shop apps so we can control our authentication thru a single point. Could this module help with this?

I think we could share either tokens our sessions to achieve this goal. Having some trouble getting pointed in the correct direction or perhaps this just isn't feasable? Thank you

---

<div class="post-metadata">

**Author:** ![kyvislabs](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kyvislabs/32/26325_2.png) [@kyvislabs](https://forum.inductiveautomation.com/u/kyvislabs)\
**Post date:** [October 17, 2023, 7:03pm UTC](https://forum.inductiveautomation.com/t/kyvis-labs-api-client-module/69120/33 "2023-10-17T19:03:21Z")

</div>

1. Yes. There is support for Basic Auth.
2. You can change the password the module is sending the api you are calling.

---

<div class="post-metadata">

**Author:** ![kyvislabs](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kyvislabs/32/26325_2.png) [@kyvislabs](https://forum.inductiveautomation.com/u/kyvislabs)\
**Post date:** [October 17, 2023, 7:03pm UTC](https://forum.inductiveautomation.com/t/kyvis-labs-api-client-module/69120/34 "2023-10-17T19:03:50Z")

</div>

We will need some more information. Do the apps expose an API?

---

<div class="post-metadata">

**Author:** ![Joshua\_Dingus](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@Joshua\_Dingus](https://forum.inductiveautomation.com/u/Joshua_Dingus)\
**Post date:** [October 17, 2023, 7:41pm UTC](https://forum.inductiveautomation.com/t/kyvis-labs-api-client-module/69120/35 "2023-10-17T19:41:12Z")

</div>

Yes, these are for the most part, web REST api based applications that are leveraging their own authentication system.

The applications we are wanting to integrate with Ignition are standard ASP. Net Core applications.

---

<div class="post-metadata">

**Author:** ![kyvislabs](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kyvislabs/32/26325_2.png) [@kyvislabs](https://forum.inductiveautomation.com/u/kyvislabs)\
**Post date:** [October 17, 2023, 7:59pm UTC](https://forum.inductiveautomation.com/t/kyvis-labs-api-client-module/69120/36 "2023-10-17T19:59:15Z")

</div>

This module will land values from those APIs into the tag system. The webdev module is probably what you want.

---

<div class="post-metadata">

**Author:** ![Henrique\_Starosky](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/henrique_starosky/32/81725_2.png) [@Henrique\_Starosky](https://forum.inductiveautomation.com/u/Henrique_Starosky)\
**Post date:** [December 4, 2023, 8:37pm UTC](https://forum.inductiveautomation.com/t/kyvis-labs-api-client-module/69120/37 "2023-12-04T20:37:08Z")

</div>

Hey @kyvislabs! I'm having some troubles using `action: script` on our gateway (8.1.33). I've set both the project and function path (I believe it's supposed to be folder.folder.file.defName, right?). I've set the API log debug levels, and I noticed that in handleResponse (from ScriptAction.java) the logger.debug tries to use two getters, but they return Objects, rather than the Strings contained in those objects. It's possible that the reason behind the failure in the script execution might be the same, but I'm yet to learn the inner workings of the SDK to be sure.

The error I get is this:

```auto
com.kyvislabs.api.client.common.exceptions.APIException: Error handling script action
at com.kyvislabs.api.client.gateway.api.functions.actions.actions.ScriptAction.handleResponse(ScriptAction.java:70)
at com.kyvislabs.api.client.gateway.api.functions.Actions.handleResponse(Actions.java:45)
at com.kyvislabs.api.client.gateway.api.functions.FunctionExecutor._execute(FunctionExecutor.java:146)
at com.kyvislabs.api.client.gateway.api.functions.FunctionExecutor.execute(FunctionExecutor.java:183)
at com.kyvislabs.api.client.gateway.api.functions.FunctionExecutor.run(FunctionExecutor.java:209)
at com.inductiveautomation.ignition.common.execution.impl.BasicExecutionEngine$ThrowableCatchingRunnable.run(BasicExecutionEngine.java:544)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: com.inductiveautomation.ignition.common.script.JythonExecException: Traceback (most recent call last): File "APIScriptAction", line 1, in AttributeError: 'com.inductiveautomation.ignition.common.script.Pro' object has no attribute 'parseCameraResponse'
at org.python.core.Py.AttributeError(Py.java:178)
at org.python.core.PyObject.noAttributeError(PyObject.java:965)
at org.python.core.PyObject. __getattr__ (PyObject.java:959)
at org.python.pycode._pyx3236089.f$0(APIScriptAction:1)
at org.python.pycode._pyx3236089.call_function(APIScriptAction)
at org.python.core.PyTableCode.call(PyTableCode.java:173)
at org.python.core.PyCode.call(PyCode.java:18)
at org.python.core.Py.runCode(Py.java:1687)
at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:804)
at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$TrackingProjectScriptManager.runCode(ProjectScriptLifecycle.java:843)
at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:773)
at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$TrackingProjectScriptManager.runCode(ProjectScriptLifecycle.java:834)
at com.kyvislabs.api.client.gateway.api.functions.actions.actions.ScriptAction.handleResponse(ScriptAction.java:68)
... 11 common frames omitted
Caused by: org.python.core.PyException: AttributeError: 'com.inductiveautomation.ignition.common.script.Pro' object has no attribute 'parseCameraResponse'
... 24 common frames omitted

```

On the debug log that I mentioned:

```auto
Handling script action with [project=com.kyvislabs.api.client.gateway.api.ValueString@1386131a, script=com.kyvislabs.api.client.gateway.api.ValueString@36d58cf5]

```

In case there is more info needed, I'll provide whatever is needed.

---

<div class="post-metadata">

**Author:** ![calimero100582](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/calimero100582/32/18630_2.png) [@calimero100582](https://forum.inductiveautomation.com/u/calimero100582)\
**Post date:** [December 18, 2023, 6:58pm UTC](https://forum.inductiveautomation.com/t/kyvis-labs-api-client-module/69120/38 "2023-12-18T18:58:56Z")

</div>

There is already auto-documented Api with OpenAPI/Swagger. Is it a plan to support those also?

See example below  
[https://editor.swagger.io/?url=https://ga4gh.github.io/task-execution-schemas/openapi.yaml](https://editor.swagger.io/?url=https://ga4gh.github.io/task-execution-schemas/openapi.yaml)

---

<div class="post-metadata">

**Author:** ![grietveld](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/grietveld/32/6984_2.png) [@grietveld](https://forum.inductiveautomation.com/u/grietveld)\
**Post date:** [January 3, 2024, 5:47pm UTC](https://forum.inductiveautomation.com/t/kyvis-labs-api-client-module/69120/39 "2024-01-03T17:47:10Z")

</div>

Is there any code examples for setting up or modifying the YAML files for cron or tag triggered events? Looks like most of the example configurations are all setup for timer based polling.

---

<div class="post-metadata">

**Author:** ![roland.scheuer](https://avatars.discourse-cdn.com/v4/letter/r/c57346/32.png) [@roland.scheuer](https://forum.inductiveautomation.com/u/roland.scheuer)\
**Post date:** [April 11, 2024, 8:47am UTC](https://forum.inductiveautomation.com/t/kyvis-labs-api-client-module/69120/41 "2024-04-11T08:47:54Z")

</div>

Hi,

first of all really nice module, Good Job!

I have a question to setup a post API. Is it somehow possible do  
use a Value of a existing Tag in the body?  
something like this?

```auto
    body:
      type: json
      value: |
          {
            "test_variable" : "{{Tag | [default]test_tag_to_transfer}}"
          }

```

Thank you !

[Previous page](https://forum.inductiveautomation.com/t/kyvis-labs-api-client-module/69120.md?page=1)

[Next page](https://forum.inductiveautomation.com/t/kyvis-labs-api-client-module/69120.md?page=3)
