unificationengine

Posting a Tweet with Unification Engine


When adding a connection using the Twitter connector offered by the Unification Engine, what are the parameters that need to be used and how are they to be passed in the URI?


Solution

  • To send tweet use

    curl -XPOST https://apiv2.unificationengine.com/v2/message/send \
    --data "{ \"message\": { \"receivers\": [{\"name\": \"name\", \"address\": \"TWITTER_HANDLE\" , \"Connector\": \"UNIQUE_CONNECTION_IDENTIFIER\"}],\"parts\": [{\"id\": \"1\",\"contentType\": \"text/plain\", \"data\":\"MESSAGE_CONTENT\" ,\"size\": MESSAGE_CONTENT_SIZE,\"type\": \"body\",\"sort\":0}]}}" \
    -u USER_ACCESSKEY:USER_ACCESSSECRET -k
    

    Where USER_ACCESSKEY:USER_ACCESSSECRET is got when you add the user using UE_APPKEY:UE_APPSECRET

    curl -XPOST https://apiv2.unificationengine.com/v2/user/create -u UE_APPKEY:UE_APPSECRET \
    --data '{}' -k
    

    Response data:

    {"status":200,"info":"200 OK","uri":"user://USER_ACCESSKEY:USER_ACCESSSECRET"}