Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. $.ajax({
  2. type: "GET",
  3. contentType: "application/json; charset=utf-8",
  4. datatype: "json",
  5. url: ORGANIZATION_URL+ "/XRMServices/2011/OrganizationData.svc/AccountSet?$select=AccountNumber,Telephone1,Telephone2,new_CustomerDiscGroup,EMailAddress1,EMailAddress2,EMailAddress3",
  6. beforeSend: function (XMLHttpRequest) {
  7. XMLHttpRequest.setRequestHeader("Accept", "application/json");
  8. console.log(XMLHttpRequest);
  9. },
  10. complete: function (XmlHttpRequest) {
  11. console.log(XMLHttpRequest);
  12. },
  13. success: function (data, textStatus, XmlHttpRequest) {
  14. console.log(data);
  15. },
  16. error: function (XmlHttpRequest, textStatus, errorThrown) {
  17. console.log(textStatus);
  18. }
  19. });
  20.  
  21. $.ajax({
  22. url : 'https://<Your Authentication URL for CRM>/adfs/ls',
  23. data : {
  24. UserName : '<username>',
  25. Password : '<password>',
  26. wa : 'wsignin1.0',
  27. wauth : 'urn:federation:authentication:windows',
  28. wtrealm : '<CRM Location>',
  29. wct : 'YYYY-MM-DDTHH:MM:SSZ'
  30. },
  31. headers : {
  32. Accept: 'image/jpeg, application/x-ms-application, image/gif, application/xaml+xml, image/pjpeg, application/x-ms-xbap,application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*','Content-Type': 'application/x-www-form-urlencoded','Access-Control-Allow-Origin' : '*'
  33. },
  34. crossDomain: true,
  35. dataType: 'jsonp',
  36. beforeSend : function(xhr){
  37. console.log(xhr);
  38. },
  39. complete : function(xhr){
  40. console.log(xhr);
  41. },
  42. success : function(xhr){
  43. console.log(xhr);
  44. },
  45. error : function(xhr){
  46. console.log(xhr);
  47. }
  48. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement