TGV: Train with Great Velocity ACTION

Call API

by Manuchap
Locomotive 3.x

Query the restful v3 api and get a json response.

---
title: Info page
response_type: application/json
---
{% action 'Call API' %}
var info = false;
info = callAPI('GET', 'http://YOURENGINE/locomotive/api/v3/current_site.json', {
data: {
},
headers: {
'X-Locomotive-Account-Token': {{site.metafields.info.token}},
'X-Locomotive-Account-Email': {{site.metafields.info.email}},
'X-Locomotive-Site-Handle': {{site.metafields.info.handle}}
}
});
setProp('info', info);
{% endaction %}
{% if info %}
{{ info | split: "=>" | join: ": " | split: "nil" | join: '"NULL"' }}
{% else %}
Failure!
{% endif %}

  Back to the list
X

Signup


X

Sign-in