DataJet
Search…
Blank HTTP
Anytime you create Blank HTTP task, an endpoint will be generated. By calling this endpoint, you will trigger the task. Additionally, you can return a response to any client that called this endpoint. It might be useful when on storefront you need to fetch store's data that is not available through Shopify Storefront API (inventory levels lookup, gift card balance lookup etc.).

Calling autogenerated task endpoint

After you create the task, you will find autogenerated endpoint in app dashboard (after you select newly created task from the list on the right).
It will look something like that:
https://your-store-name.myshopify.com/apps/datajet/task/task_id
When calling the endpoint from your storefront you can use this short version:
/apps/datajet/task/task_id
Task responds only to POST request.
Additionally, you need to include header parameter named token. You will find value for this header just under autogenerated endpoint. Token validation can be disabled in task options.
Endpoint won't work if your storefront is password protected. Disable storefront password or contact us to get development endpoint for your task.

Returning response to client

Let's have a look at simple example in which our task is going to return "status": "ok" response to client.
1
{% json response %}
2
{
3
"body": {
4
"status": "ok"
5
},
6
"headers": {
7
"Content-Type": "application/json"
8
},
9
"status": 200
10
}
11
{% endjson %}
Copied!
In above example, response is a global object. This variable will be always returned to the client when Blank HTTP task is called. This is what would be returned to client:
1
{
2
status: "ok"
3
}
Copied!