Skip to content

Instantly share code, notes, and snippets.

How to create geo in backand.
1. Create a new query.
Give it a name and save.
2. In text enter table creation script
Example:
CREATE TABLE `nodes` (
`id` int(11) PRIMARY KEY,
`geom` geometry NOT NULL,

###Basic Auth To use Admin's permission in the server side action or imperonsate to other user use basic auth Authorization header:

###Back& server side Action In the action change the headers code to be this line:

headers:{'Authorization':'basic ' + btoa (username + ':'+ password) }

Use this code snippet of Android in order to access Back&, make a GET call that returns string which you can transform into JSON:

StringBuilder stringBuilder = new StringBuilder();
try {
    String authorization = "<< AnonymousToken >>";

    HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
 conn.setRequestMethod("GET");

Android code with authentication to use with Back&:

com.backand.backandandroidsample;

import android.util.Base64;
import android.util.Log;

import java.io.InputStream;
import java.io.InputStreamReader;

In order to have socket works for Backand in Angular 1.x (without Backand's SDK) do the follow:

Add this line to index.html:

  <script src="https://api.backand.com:4000/socket.io/socket.io.js"></script>

Use this service 'SocketService' for the main socket functionality:

Creating your own Facebook Messenger Bot with Backand

Facebook recently opened up their Messenger platform to enable bots to converse with users through Facebook Apps and on Facebook Pages. In support of this, the Facebook Messenger team created a comprehensive set of documentation describing the functionality on offer. While they offer a lot of functionality and platform-level integration for free, you still need to create a publicly-accessible application that Facebook can communicate with in order to communicate with your end users.

In this tutorial, we'll walk through creating your own messenger bot with a back-end ready to go, powered by Backand and live - all in 10 minutes.

Get Access Token

HttpRequest:

<?php

$request = new HttpRequest();
$request->setUrl('https://api.backand.com/token');
$request->setMethod(HTTP_METH_POST);

Check access_token is valid

HttpRequest

<?php

$request = new HttpRequest();
$request->setUrl('https://api.backand.com/1/objects/action/users/1');
$request->setMethod(HTTP_METH_GET);

Get Access Token

PHP cURL

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
@itayher
itayher / sendAttachmentWithMandrill.md
Last active February 21, 2023 11:15
Example how to send email with attachment in Mandrill using Backand node.js server side action

Example how to send email with attachment in Mandrill using Backand node.js server side action

Installations

  1. Create new node.js on-demand action
  2. Create acction in Mandrill and copy the API KEY
  3. Follow the instruciton by running npm backand and 'backand action deploy' command

Code Update

In index.js file add these lines before 'exports.backandCallback' function.