{"action":"opened","issue":{"url":"https://api.github.com/repos/gitbrent/SpRestLib/issues/8","repository_url":"https://api.github.com/repos/gitbrent/SpRestLib","labels_url":"https://api.github.com/repos/gitbrent/SpRestLib/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/gitbrent/SpRestLib/issues/8/comments","events_url":"https://api.github.com/repos/gitbrent/SpRestLib/issues/8/events","html_url":"https://github.com/gitbrent/SpRestLib/issues/8","id":285291067,"number":8,"title":"not able to pass site url for \"User Methods\"","user":{"login":"YakQin","id":17231180,"avatar_url":"https://avatars3.githubusercontent.com/u/17231180?v=4","gravatar_id":"","url":"https://api.github.com/users/YakQin","html_url":"https://github.com/YakQin","followers_url":"https://api.github.com/users/YakQin/followers","following_url":"https://api.github.com/users/YakQin/following{/other_user}","gists_url":"https://api.github.com/users/YakQin/gists{/gist_id}","starred_url":"https://api.github.com/users/YakQin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YakQin/subscriptions","organizations_url":"https://api.github.com/users/YakQin/orgs","repos_url":"https://api.github.com/users/YakQin/repos","events_url":"https://api.github.com/users/YakQin/events{/privacy}","received_events_url":"https://api.github.com/users/YakQin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-01-01T06:31:22Z","updated_at":"2018-01-01T06:31:22Z","closed_at":null,"author_association":"NONE","body":"Hello,\r\nI looked into the source code too but I did not find a way to pass the site url for \"User Methods\". I usually complete the application (js, css, html) locally and then when everything is fine I upload the package to sharepoint folder then users can access the .aspx pages (changed extension from html to aspx) So I always use the complete sharepoint site url. \r\n\r\nSo if you can set global var for the baseUrl for all functions or at least for the User Methods then it will be much more useful.\r\n\r\nCurrently I use the original Ajax call for all the projects\r\n\r\n`function currentLogin() {\r\n     $.ajax({\r\n         url: \"xxxx/teams/apmt/_api/SP.UserProfiles.PeopleManager/GetMyProperties?$select=DisplayName,Email\",\r\n         async: false,\r\n         type: 'get',\r\n         headers: {\r\n             \"Accept\": \"application/json;odata=verbose\"\r\n         },\r\n         cache: false,\r\n         //dataType: 'json',\r\n         success: function(spJsonData) {\r\n             //get user name\r\n             var pageDisplayName;\r\n             var displayName = spJsonData.d.DisplayName\r\n             var isLongerDisplayName = displayName.search(/[(]/)\r\n             if (isLongerDisplayName != -1) {\r\n                 var bracketStart = displayName.indexOf(\"(\")\r\n                 pageDisplayName = displayName.substring(0, bracketStart)\r\n             } else(pageDisplayName = spJsonData.d.DisplayName)\r\n             var loginMsg = \"Welcome \" + pageDisplayName\r\n             $(\"#login-name\").html(loginMsg)\r\n             //get user mail id\r\n             $(\"#userMail\").html(spJsonData.d.Email)\r\n             var picURL = \"url(https://outlook.office365.com/owa/service.svc/s/GetPersonaPhoto?email=\" + spJsonData.d.Email + \")\"\r\n             $(\"#login-image\").css(\"background-image\", picURL)\r\n         },\r\n         error: function() {\r\n             $(\"#login-name\").html(\"Welcome ,[...]\")\r\n         }\r\n     });\r\n }`\r\n"}}
{"actor":{"display_login":"YakQin"}}