Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Ibrahim IbrahimTareq

🎯
Focusing
View GitHub Profile
@IbrahimTareq
IbrahimTareq / index.js
Created May 4, 2018
Start-up code for your Slackbot
View index.js
// Add support for environmental variables
require('dotenv/config');
// Import botkit package
var Botkit = require('botkit');
// Create a controller for the Slackbot
var controller = Botkit.slackbot({
  debug: false
});
@IbrahimTareq
IbrahimTareq / mm-messages.js
Created May 12, 2018
MessageMedia Messages Node.js
View mm-messages.js
const sdk = require('messagemedia-messages-sdk');
const controller = sdk.MessagesController;
// Configuration parameters and credentials
sdk.Configuration.basicAuthUserName = "YOUR_API_KEY"; // Your API Key
sdk.Configuration.basicAuthPassword = "YOUR_SECRET_KEY"; // Your Secret Key
var body = new sdk.SendMessagesRequest({
@IbrahimTareq
IbrahimTareq / mm-messages.py
Created May 12, 2018
MessageMedia Messages Python
View mm-messages.py
from message_media_messages.message_media_messages_client import MessageMediaMessagesClient
import json
# Configuration parameters and credentials
auth_user_name = 'YOUR_API_KEY' # The username to use with basic/HMAC authentication
auth_password = 'YOUR_API_SECRET' # The password to use with basic/HMAC authentication
use_hmac_authentication = False # Change to True if you are using HMAC keys
client = MessageMediaMessagesClient(auth_user_name, auth_password, use_hmac_authentication)
@IbrahimTareq
IbrahimTareq / mm-messages.php
Last active May 12, 2018
MessageMedia Messages PHP
View mm-messages.php
<?php
require_once "vendor/autoload.php";
use MessageMediaMessagesLib\MessageMediaMessagesClient;
use MessageMediaMessagesLib\APIHelper;
$authUserName = 'YOUR_API_KEY'; // The API key to use with basic/HMAC authentication
$authPassword = 'YOUR_API_SECRET'; // The API secret to use with basic/HMAC authentication
$useHmacAuthentication = false; // Change to true if you are using HMAC keys
@IbrahimTareq
IbrahimTareq / mm-messages.java
Created May 12, 2018
MessageMedia Messages Java
View mm-messages.java
package com.company;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.messagemedia.messages.MessageMediaMessagesClient;
import com.messagemedia.messages.controllers.MessagesController;
import com.messagemedia.messages.models.SendMessagesRequest;
import com.fasterxml.jackson.core.type.TypeReference;
public class Main {
public static void main(String[] args) throws Throwable {
@IbrahimTareq
IbrahimTareq / mm-messages.rb
Created May 12, 2018
MessageMedia Messages Ruby
View mm-messages.rb
require 'message_media_messages'
require 'pp'
# Configuration parameters and credentials
auth_user_name = 'API_KEY' # The username to use with basic/HMAC authentication
auth_password = 'API_SECRET' # The password to use with basic/HMAC authentication
use_hmac = false # Change this to true if you are using HMAC keys
client = MessageMediaMessages::MessageMediaMessagesClient.new(
auth_user_name: auth_user_name,
@IbrahimTareq
IbrahimTareq / mm-messages.cs
Created May 12, 2018
MessageMedia Messages C#
View mm-messages.cs
using System;
using MessageMedia.Messages;
using MessageMedia.Messages.Controllers;
using MessageMedia.Messages.Models;
namespace TestCSharpSDK
{
class Program
{
static void Main(string[] args)
@IbrahimTareq
IbrahimTareq / mm-messages.go
Created May 12, 2018
MessageMedia Messages GO
View mm-messages.go
package main
import (
"encoding/json"
"fmt"
"github.com/messagemedia/messages-go-sdk"
"github.com/messagemedia/messages-go-sdk/messages_pkg"
"github.com/messagemedia/messages-go-sdk/models_pkg"
)
@IbrahimTareq
IbrahimTareq / retrieve-webhooks.js
Created May 21, 2018
Code snippet on how to retrieve all webhooks created using the MessageMedia Webhooks Node.js SDK.
View retrieve-webhooks.js
function retrieveWebhook(){
var controller = setup();
var page = 0;
var pageSize = 0;
controller.retrieveWebhook(page, pageSize, function(error, response, context) {
console.log(response);
});
}
@IbrahimTareq
IbrahimTareq / delete-webhook.js
Last active May 21, 2018
Code snippet on how to delete a webhook using the MessageMedia Webhooks Node.js SDK.
View delete-webhook.js
function deleteWebhook(){
var controller = setup();
// The id of the webhook that you would like to delete
var webhookId = "WEBHOOK_ID";
// Call the function that deletes the webhook
controller.deleteWebhook(webhookId, function(error, response, context) {
console.log(response);
});
You can’t perform that action at this time.