API endpoint help

I can’t figure out how turn on the Fullscreen button via MIDI - API endpoint with keyboardmaestro…

I use the endpoints like this

http://localhost:8989 + contents of Clipboard + /recall (or ToogleLive, etc)

it’s a boolean value. You have to copy the link to trigger it ‘on’ and/or the link to trigger it ‘off’. (Right-click on the ‘label’ “Show Fullscreen” and see context menu.)

Over the right-click-on-label-method you’ll get most of the necessary links. BTW, it does not work for things without label. Unfortunately.)

PS: Here the scheme for your particular switch:

  1. on:

http://127.0.0.1:8989/api/v1/documents/YOUR-DOCUMENT-ID/layers/YOUR-LAYER-ID/variants/YOUR-VARIANT-ID?include=data.attributes.input-values&fields[input-values]=tvGroup_Control__Show_Fullscreen&update=%7B%22input-values%22:%7B%22tvGroup_Control__Show_Fullscreen%22:true%7D%7D

if “true” does not work, use 1:
http://127.0.0.1:8989/api/v1/documents/YOUR-DOCUMENT-ID/layers/YOUR-LAYER-ID/variants/YOUR-VARIANT-ID?include=data.attributes.input-values&fields[input-values]=tvGroup_Control__Show_Fullscreen&update=%7B%22input-values%22:%7B%22tvGroup_Control__Show_Fullscreen%22:1%7D%7D

  1. off:

http://127.0.0.1:8989/api/v1/documents/YOUR-DOCUMENT-ID/layers/YOUR-LAYER-ID/variants/YOUR-VARIANT-ID?include=data.attributes.input-values&fields[input-values]=tvGroup_Control__Show_Fullscreen&update=%7B%22input-values%22:%7B%22tvGroup_Control__Show_Fullscreen%22:false%7D%7D

if “false” does not work, use 0:
http://127.0.0.1:8989/api/v1/documents/YOUR-DOCUMENT-ID/layers/YOUR-LAYER-ID/variants/YOUR-VARIANT-ID?include=data.attributes.input-values&fields[input-values]=tvGroup_Control__Show_Fullscreen&update=%7B%22input-values%22:%7B%22tvGroup_Control__Show_Fullscreen%22:0%7D%7D

Replace YOUR-DOCUMENT-ID, YOUR-LAYER-ID and YOUR-VARIANT-ID with your individual values.

1 Like

@JoPhi thank you for your help, and sorry for my incompetence

Here is my laver api

/api/v1/documents/494566486/layers/6B42656B-5B7E-4F4B-A4A7-5681F2053D1D

And for me, in keyboard maestro would be

http://localhost:8989/api/v1/documents/494566486/layers/6B42656B-5B7E-4F4B-A4A7-5681F2053D1D

Example: If I want to turn the layer on, will be

http://localhost:8989/api/v1/documents/494566486/layers/6B42656B-5B7E-4F4B-A4A7-5681F2053D1D/toggleLive

The layer don’t have variants

The layer “Show Fullscreen” button have this api

tvGroup_Control__Show_Fullscreen

I don’t know how putt all together… :frowning:

It has. It has one variant. Open the endpoint in a browser with http://localhost:8989 as a prefix, there you’ll find the variant’s ID at > data.relationships.variants

Use Firefox to browse formatted JSON output.

Unfortunately, I cannot guess the ID for you.

1 Like

@JoPhi

Thank you very much

Seem like I have some form issues with keyboard maestro and the way it process the URL’s

If I type the full endpoint in the browser and hit enter, the action works.

But, if I put the url in keyboard maestro, I have an orange warning, and nothing happens

Maybe @DaveTheNerd, @Oliver_Boinx , @Achim_Boinx have a clue?

You try ro set a flag for a boolean and to simultaneously switch the layer on. This does not work. At least not without a script between.

Btw. update-request and setLive are two actions.

1 Like

@JMVBMW In your screenshot I can see that you have quotation marks " in your URL. Those are not allowed in a URL to be valid. The browser actually does some magic to convert them to the proper %-encoding (%22) this is way the same URL works in the browser. Usually I use some online URL encoding/decoding service (like https://www.urlencoder.org ) to generate the correct form for the URL. In your case it is already mixed up and so I think those services will have a hard time to fix the URL for you. Maybe it is enough if you exchange all " with %22 but because its only a small portion we can see in the screenshot you may need to exchange other characters as well.

1 Like

Yes, and update+setLive is not possible the same time.

1 Like

@Achim_Boinx, thank you for answer

Here is the complete url to keyboard maestro

http://localhost:8989//api/v1/documents/1341580843/layers/6E30224D-FCCE-4040-865F-EA98FEDBA28A/variants/921624A3-B396-4989-90CD-E967F3F1C534?include=data.attributes.input-values&fields[input-values]=tvGroup_Control__Show_Fullscreen&update={“input-values”%3A{“tvGroup_Control__Show_Fullscreen”%3Atrue}}

you mean?

No joy :frowning:

delete everything after update= and use

%7B%22input-values%22%3A%7B%22tvGroup_Control__Show_Fullscreen%22%3A1%7D%7D
1 Like

No joy, and keyboard maestro keep warning me that something is wrong

this one, actually work in my browser, if I hit enter

http://localhost:8989/api/v1/documents/1341580843/layers/6E30224D-FCCE-4040-865F-EA98FEDBA28A/variants/921624A3-B396-4989-90CD-E967F3F1C534?include=data.attributes.input-values&fields[input-values]=tvGroup_Control__Show_Fullscreen&update=%7B%22input-values%22%3A%7B%22tvGroup_Control__Show_Fullscreen%22%3Atrue%7D%7D

GOT IT!!
I have to change a parameter in keyboard maestro!

Thank you guys for all you help!!

1 Like