SHARE
TWEET

Untitled

a guest Jul 17th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var obj = {
  2.     message: {
  3.         "attachments": [],
  4.         "content": {
  5.             "text": "dtest api 12345",
  6.             "tags": []
  7.         },
  8.         "userContext": {}
  9.     },
  10.     channelID: 'ac3b5245-5253-49d4-9a2c-4ea83b14391a'
  11.  
  12. }
  13.  
  14.  
  15.  
  16. function PostMessage(obj) {
  17.     var param = {
  18.         Domain: APP.DATA.DOMODOMAIN,
  19.         BuzzEndpoint: '/api/buzz/v1/channels/{channelID}/messages?mentionsGrantPermission=true',
  20.         Token: token,
  21.         Data: JSON.stringify(obj.message),
  22.  
  23.     }
  24.  
  25.     param.BuzzEndpoint = param.BuzzEndpoint.replace('{channelID}', obj.channelID);
  26.  
  27.     $.ajax({
  28.         type: "POST",
  29.         //contentType:"application/json; charset=utf-8",
  30.         url: "https://ki-dev.outsystemsenterprise.com/DomoAPI/rest/BuzzV2/PostData",
  31.         data: JSON.stringify(param),
  32.  
  33.         success: function(res) {
  34.             console.log(res);
  35.         }
  36.     });
  37.  
  38.  
  39. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top