Guest User

Untitled

a guest
Jul 22nd, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title></title>
  6. <meta name="description" content="">
  7. <meta name="viewport" content="width=device-width, initial-scale=1">
  8. <script runat="server">
  9.  
  10. Platform.Load("Core","1.1.1");
  11. try {
  12. </script>
  13. %%[
  14. Var @body, @callstatus, @response<br>
  15. Set @body = '{<br>
  16. "grant_type":"password",<br>
  17. "clientId":"Id",<br>
  18. "clientSecret":"****",<br>
  19. "username":"test@email",<br>
  20. "password":"MyPassword12345"<br>
  21. }'<br>
  22. HTTPPost2("https://login.salesforce.com/services/oauth2/token", "application/x-www-form-urlencoded", @body, True, @callstatus, @response)<br>
  23. ]%% <br>
  24. <script type="text/javascript" runat="server">
  25. } catch (e) {
  26. Write(Stringify(e));
  27. }
  28. </script><br>
  29. Call:%%=v(@callstatus)=%%<br>
  30. Res:%%=v(@response)=%%
  31. </head>
  32. <body>
  33. </body>
  34. </html>
  35.  
  36. {"message":"The function expression is invalid. See inner exception for detail.rn <br>
  37. Script: HTTPPost2("https://login.salesforce.com/services/oauth2/token", "application/x-www-form-urlencoded", @body, True, @callstatus, @response)rn<br>
  38. Index: 1098rn<br> ListID: 0rn" ,<br>
  39. "description":"ExactTaOMM.InvalidScriptException: The function expression is invalid. See inner exception for detail.rn<br>
  40. Script: HTTPPost2("https://login.salesforce.com/services/oauth2/token", "application/x-www-form-urlencoded", @body, True, @callstatus, @response)rn
  41. Index: 1098rn ListID: 0rn <br>
  42. Error Code: OMM_FUNC_EXPR_INVALIDrn<br>
  43. - from Jint --> rnrn<br>
  44. --- inner exception 1---rnrnExactTarget.OMM.FunctionExecutionException: An error occurred when attempting to evaluate a HTTPPost2 function call. See inner exception for details.rn<br>
  45. Error Code: OMM_FUNC_EXEC_ERRORrn - from OMMCommon --> rnrn<br>
  46. --- inner exception 2---rnrnSystem.Net.WebException: The remote server returned an error: (400) Bad Request. - from Systemrnrnrnrnrnrn"} <br>
  47. Call: Res:
Add Comment
Please, Sign In to add comment