Skip to content

Instantly share code, notes, and snippets.

Avatar

Jorge Alcantara Barroso jalcantarab

View GitHub Profile
@jalcantarab
jalcantarab / content-json-sample.json
Last active Nov 21, 2017
Sample JSON showing the structure of the feed for a project with fields (Title, URL, Answer, Paragraphs[]). Paragraphs being a multifield (array)
View content-json-sample.json
{
"contents": [
{
"TITLE": "Content 1 Title",
"CATEGORY": ["category",
"subcategory"
],
"PROFILES": {
"1": "F2B_DEFAULT",
"2": "F2B_INACTIVE",
@jalcantarab
jalcantarab / _jsonPuller.md
Last active Nov 2, 2021 — forked from crstamps2/jsonPuller
A Google apps script to pull json from a spreadsheet
View _jsonPuller.md

JSON Puller - Google Apps Script

Transforms the data of a given Spreadsheet Sheet to JSON.

  • The frozen rows are taken as keys for the JSON.
  • The data taken for the values is only that after the frozen rows

Set up:

exportJSON(Spreadsheet) - transforms the data in the given sheet to JSON.

@jalcantarab
jalcantarab / _InbentaApiMethods.md
Last active Nov 18, 2021
Google App Script Examples of some of the Inbenta API endpoints
View _InbentaApiMethods.md

Inbenta API - Google Apps Script Examples (~JavaScript)

Check out the official documentation of the Inbenta API at Getting Started. This gist is done for API version v1. To check out SDK examples in JavaScript, check this out

Overview

All the API access is over HTTPS. The response format for all requests is a JSON object. Whether a request succeeded is indicated by the HTTP status code. A 2xx status code indicates success, otherwise failure. When a request fails, the response body is still JSON.

Authentication

Authentication is done via HTTP headers, more information in the Authorization section. The calls in this gist all authenticate doing a call to getApiData(), which retrieves a token from POST /auth, and the list of api endpoints from GET /apis.

@jalcantarab
jalcantarab / ShopifyScripts.md
Last active Feb 13, 2020
Simple Shopify API calls examples
View ShopifyScripts.md

Shopify API - Script examples

Simple examples of calls to the Shopify API using Google Apps Script (.gs). So far:

  • ssCatalogPublicationStatus.gs - Meant as an addon for Google Sheets to check the publication status of items.
    • getCatalogJSON() - Returns complete JSON catalog for an instance.
    • checkPublicationStatus() - Checks a list of handle-ids in Google Sheets against a JSON catalog Compares the first column of a google spreadsheet to the JSON Shopify catalog. Adds published date to third column, and verifies date to published status.
@jalcantarab
jalcantarab / _InbentaChatbotSDKSample.md
Last active Sep 12, 2018
Example of Custom Integration of the Inbenta Chatbot SDK
View _InbentaChatbotSDKSample.md

Chatbot SDK Example - Custom Build

Simple example of a functioning chatbot SDK User Interface. All contained in one HTML file. This example is meant to show how to:

  • Customize configuration of the SDK build,
  • Customize the labels to align with your desired language and personality,
  • Customize some CSS to fit your colors and icons,
  • How to use the /auth API method to retrieve the API Token.

If you're looking for a more complex integration, or want to see the JS<>CSS<>HTML separate: GO HERE