This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#HTML response CodeBox | |
content = "<html>\ | |
<head>\ | |
</head>\ | |
<body>\ | |
<p>Welcome from Syncano Webhook!</p>\ | |
<p><a href=\"https://www.syncano.io/\">Visit our website</a></p>\ | |
<p>You're inside an instance named {instance}</p>\ | |
<p>Watch \"Stop Building the Backend\" talk by our Developer Evangelist Kelly Andrews</p>\ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// TestQuestions.swift | |
// TestWarningsSwift | |
// | |
// Created by Mariusz Wisniewski on 2/2/16. | |
// Copyright © 2016 Mariusz Wisniewski. All rights reserved. | |
// | |
import Foundation | |
import syncano_ios |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
array = [1,2,3,4,5,6,7,8,9] | |
dictionary = { | |
"status" : "OK", | |
"message" : "Visit us", | |
"url" : "https://www.syncano.io", | |
"array" : array | |
} | |
content = JSON.stringify(dictionary) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Book : SCDataObject { | |
var title = "" | |
var subtitle = "" | |
// add SCFile property as any other property on your class | |
var cover : SCFile? = nil | |
} | |
class MyClass { | |
func sendImage() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
content = "<html>\ | |
<head>\ | |
</head>\ | |
<body>\ | |
<p>Welcome from Syncano Webhook!</p>\ | |
<p><a href=\"https://www.syncano.io/\">Visit our website</a></p>\ | |
<p>You're inside an instance named {instance}</p>\ | |
<p>Watch \"Stop Building the Backend\" talk by our Developer Evangelist Kelly Andrews</p>\ | |
<p><iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/zKLMc4ZoQJo\" frameborder=\"0\" allowfullscreen></iframe></p>\ | |
</body>\ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
content = "<html>\ | |
<head>\ | |
<meta http-equiv=\"Refresh\" content=\"0; url=https://www.syncano.io/\" />\ | |
</head>\ | |
<body>\ | |
<p>Please follow <a href=\"https://www.syncano.io/\">this link</a>.</p>\ | |
</body>\ | |
</html>" | |
redirectResponse = HttpResponse(status_code=302, content=content, content_type='text/html'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import time | |
client_id = "" | |
client_secret = "" | |
limit = 10 | |
default_what = "sushi" | |
what = ARGS["POST"].get("what","") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let syncano = Syncano(apiKey: "API-KEY", instanceName: "INSTANCE-NAME") | |
func printError(error: NSError?) { | |
guard let error = error else { | |
return | |
} | |
let userInfo = error.userInfo | |
let syncanoError = userInfo[kSyncanoResponseErrorKey] | |
let detail = syncanoError?["detail"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Author { | |
var name = "" | |
init(name: String) { | |
self.name = name | |
} | |
} | |
class Book { | |
var author : Author? = nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
# I'll use direct API call, to show the logic of it - I don't want to cloud it with how certain libraries might work | |
# we check if the user_key was passed to the webhook | |
user_key = ARGS["POST"].get("user_key","") | |
if not user_key: | |
user_key = ARGS["GET"].get("user_key","") | |