Skip to content

Manager of identities for notifications and messages of AppCivist

License

Notifications You must be signed in to change notification settings

socialappslab/entity-manager

Repository files navigation

appcivist-identity-manager

Manager of identities for notifications and messages of AppCivist

Setup

Install node

I have been using v0.10.15 for initial development and testing

Install MongoDB and create collection

I have been using v2.4.5 for initial development and testing Run mongo:

mongod &

Create collection in mongo:

mongo
db.createCollection('entitymanagerservice')

Pull from GitHub

Get a local copy of the project (using git or copy the zip) and then use the node package manager to install needed prereqs defined in package.json ...

npm install

Setup environment variables on your OS. The project required this two environment variables:

USNB_MONGO_URI_ENTITY_MANAGER = mongodb://[host]:27017/entitymanagerservice
USNB_ENTITY_MANAGER_PORT = any port you want to use (8889)

then start the server ...

node start.js

Entity Management API

Register a user:

curl -X POST -H "Content-Type: application/json" -d '{
    "userId": "[email protected]",
    "name": "Test User"
}' "http://localhost:3025/users"

Register social interaction services identities for that user:

curl -X POST -H "Content-Type: application/json" -d '{
    "userId": "[email protected]",
    "serviceId": "facebookmessengerbot",
    "identity": "184858454541",
    "enabled": true
}' "http://localhost:3025/identities"


curl -X POST -H "Content-Type: application/json" -d '{
    "userId": "[email protected]",
    "serviceId": "email",
    "identity": "[email protected]",
    "enabled": true
}' "http://localhost:3025/identities"

In the case of Facebook Messenger, it will be the bot itself who will register the Facebook Messenger identity following checkbox plugin or the account linking processes.

Set the preferred social interaction for that user:

curl -X POST -H "Content-Type: application/json" -d '{
    "userId": "[email protected]",
    "serviceId": "facebookmessengerbot"
}' "http://localhost:3025/preferences"

Change it:

curl -X PUT -H "Content-Type: application/json" -d '{
    "serviceId": "email"
}' "http://localhost:3025/preferences/[email protected]"

About

Manager of identities for notifications and messages of AppCivist

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages