-1
전제 CRM 20에 연결하고 일부 데이터를 검색하려면이 코드를 작성했습니다. 여기CRM 2016 api 무단 액세스
는
var credentials = new NetworkCredential("username", "password?", "domain");
var client = new HttpClient(new HttpClientHandler() { Credentials = credentials })
{
BaseAddress = new Uri("https://xxxtestenv.elluciancrmrecruit.com/api/data/v8.0/")
};
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var response = client.GetAsync("datatel_events?$orderby=datatel_eventname").Result;
if (response.IsSuccessStatusCode)
{
var yourcustomobjects = response.Content.ReadAsStringAsync();
}
이다 그러나 나는이 오류를
response {StatusCode: 401, ReasonPhrase: 'Unauthorized', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{ REQ_ID를 얻을 : b685b007-199b-4a4a-85cc-3a29684e5588 날짜 : 2016년 9월 22일 (목) 19 : 27:35 GMT 서버 : Microsoft-IIS/8.5 WWW- 인증 : 협상 WWW- 인증 : NTLM X -Powered - 작성자 : ASP.NET 연결 : 연결 유지 콘텐츠 길이 : 49 콘텐츠 유형 : 텍스트/일반 }} System.Net.Http.HttpResponseMessage
어떤 제안?
IFD를 사용할 수 있습니까? –
예, 어디서나 액세스 할 수 있습니다. 나는 httpclient가 crm에 로그인하는 데 사용하는 다른 링크로 연결되는 링크를 리디렉션하는 코드를 디버깅 할 때 발견했습니다. 이 말은 정상적으로 들리니? –