System net webexception the remote server returned an error 403 forbidden

User-1078128378 posted

User-1078128378 posted

Hi All,

I want to fetch my gmail friends list

I am using the following code

friends.aspx:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Friends.aspx.cs" Inherits="Friends" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        body
        {
            font-family: Arial;
            font-size: 10pt;
        }
        table
        {
            border: 1px solid #ccc;
        }
        table th
        {
            background-color: #F7F7F7;
            color: #333;
            font-weight: bold;
        }
        table th, table td
        {
            padding: 5px;
            border-color: #ccc;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
<asp:Button ID="btnLogin" Text="Login" runat="server" OnClick="Login" />
<asp:Panel ID="pnlProfile" runat="server" Visible="false">
<hr />
<asp:GridView ID="gvContacts" runat="server" AutoGenerateColumns="false">
    <Columns>
        <asp:TemplateField HeaderText="Photo" HeaderStyle-Width="60">
            <ItemTemplate>
                <asp:Image ID="Image1" ImageUrl='<%# Eval("PhotoUrl") %>' runat="server" onerror="this.src='default.png';" />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField DataField="Name" HeaderText="Name" HeaderStyle-Width="100" />
        <asp:BoundField DataField="Email" HeaderText="Email Address" HeaderStyle-Width="100" />
    </Columns>
</asp:GridView>
</asp:Panel>
    </div>
    </form>
</body>
</html>

friends.aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.Data;
using ASPSnippets.GoogleAPI;
using System.Web.Script.Serialization;

public partial class Friends : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        GoogleConnect.ClientId = "640644024552-5liq6s2s1o1ekdbmhn2ufo9d0o4mppe4.apps.googleusercontent.com";
        GoogleConnect.ClientSecret = "6IwoiG7TqMVf7NqjliER66la";
        GoogleConnect.RedirectUri = "http://localhost:60767/Friends.aspx";
        GoogleConnect.API = EnumAPI.Contacts;
        if (!string.IsNullOrEmpty(Request.QueryString["code"]))
        {
            string code = Request.QueryString["code"];
            string json = GoogleConnect.Fetch("me", code, 10);
            GoogleContacts profile = new JavaScriptSerializer().Deserialize<GoogleContacts>(json);
            DataTable dt = new DataTable();
            dt.Columns.AddRange(new DataColumn[3] { new DataColumn("Name", typeof(string)),
                        new DataColumn("Email", typeof(string)),
                        new DataColumn("PhotoUrl",typeof(string)) });

            foreach (Contact contact in profile.Feed.Entry)
            {
                string name = contact.Title.T;
                string email = contact.GdEmail.Find(p => p.Primary).Address;
                Link photo = contact.Link.Find(p => p.Rel.EndsWith("#photo"));
                string photoUrl = GoogleConnect.GetPhotoUrl(photo != null ? photo.Href : "~/default.png");
                dt.Rows.Add(name, email, photoUrl);
                gvContacts.DataSource = dt;
                gvContacts.DataBind();
            }
            pnlProfile.Visible = true;
            btnLogin.Enabled = false;
        }
        if (Request.QueryString["error"] == "access_denied")
        {
            ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", "alert('Access denied.')", true);
        }
    }

    protected void Login(object sender, EventArgs e)
    {
        GoogleConnect.Authorize(Server.UrlEncode("https://www.google.com/m8/feeds/"));
    }


    public class GoogleContacts
    {
        public Feed Feed { get; set; }
    }

    public class Feed
    {
        public GoogleTitle Title { get; set; }
        public List<Contact> Entry { get; set; }
    }

    public class GoogleTitle
    {
        public string T { get; set; }
    }

    public class Contact
    {
        public GoogleTitle Title { get; set; }
        public List<Email> GdEmail { get; set; }
        public List<Link> Link { get; set; }
    }
    public class Email
    {
        public string Address { get; set; }
        public bool Primary { get; set; }
    }

    public class Link
    {
        public string Rel { get; set; }
        public string Type { get; set; }
        public string Href { get; set; }
    }
}

i am getting following error

Server Error in ‘/’ Application.


The remote server returned an error: (403) Forbidden.

Description: An
unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Net.WebException: The remote server returned an error: (403) Forbidden.

Source Error:

Line 21:         {
Line 22:             string code = Request.QueryString["code"];
Line 23:             string json = GoogleConnect.Fetch("me", code, 10);
Line 24:             GoogleContacts profile = new JavaScriptSerializer().Deserialize<GoogleContacts>(json);
Line 25:             DataTable dt = new DataTable();


Source File: d:Asp WebsitesGoogleLoginFriends.aspx.cs    Line: 23 

Stack Trace:

[WebException: The remote server returned an error: (403) Forbidden.]
   System.Net.HttpWebRequest.GetResponse() +6518932
   ASPSnippets.GoogleAPI.GoogleConnect.?3?(String ?11?) +128
   ASPSnippets.GoogleAPI.GoogleConnect.Fetch(String ?6?, String ?7?, Int32 ?8?) +1048
   Friends.Page_Load(Object sender, EventArgs e) in d:Asp WebsitesGoogleLoginFriends.aspx.cs:23
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51
   System.Web.UI.Control.OnLoad(EventArgs e) +92
   System.Web.UI.Control.LoadRecursive() +54
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34212

whats wrong in my code?

or is there any other example to get my gmail friends list?

Thanks,

Murali.

SharePoint Online training courses

In this SharePoint Online tutorial, we will discuss how to solve the remote server returned an error (403) forbidden SharePoint client object model error which comes in SharePoint Online/2016/2019/2013.

We will also see how to fix the error, The remote server returned an error: (500) Internal Server Error.

Recently, I was working with the SharePoint client object model (CSOM) (Microsoft.SharePoint.Client.dll) to retrieve the site title. But when I run the code, it gave an error as below while calling the ExecuteQuery() method.

An unhandled exception of type ‘System.Net.WebException’ occurred in Microsoft.SharePoint.Client.dll
Additional information: The remote server returned an error: (403) Forbidden.
Error comes like System.Net.WebException: The remote server returned an error: (403) Forbidden.
at System.Net.HttpWebRequest.GetResponse()
at Microsoft.SharePoint.Client.SPWebRequestExecutor.Execute()
at Microsoft.SharePoint.Client.ClientContext.GetFormDigestInfoPrivate()
at Microsoft.SharePoint.Client.ClientContext.EnsureFormDigest()
at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()

the remote server returned an error (403) forbidden sharepoint client object model
the remote server returned an error (403) forbidden SharePoint client object model

To work with SharePoint online client object model, we need to use Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll. We need to authenticate when we are trying to connect to SharePoint online site.

We can do this by using SharePointOnlineCredentials class which will take two parameters username and password in the Credentials property. The password in SharePoint online will be in a SecureString format.

So below is a full piece of CSOM code to retreive SharePoint site title.

private void GetSiteDetailsSPOnline(object sender, EventArgs e)
{
using (ClientContext ctx = new ClientContext("https://onlysharepoint2013.sharepoint.com/sites/sptraining/"))
{
ctx.AuthenticationMode = ClientAuthenticationMode.Default;
SecureString passWord = new SecureString();
string pwd = "MyPassword";
foreach (char c in pwd.ToCharArray()) passWord.AppendChar(c);
ctx.Credentials = new SharePointOnlineCredentials("bijay@XXXXXXXX.onmicrosoft.com", passWord);
Web web = ctx.Web;
ctx.Load(web);
ctx.ExecuteQuery();
lblResult.Text = web.Title;
}
}

Basically, we can solve The remote server returned an error: (403) Forbidden when I try to access Sharepoint error by using SharePointOnlineCredentials.

Read similar SharePoint 2013 client object model errors:

  • The remote server returned an error (401) Unauthorized SharePoint Online/2016/2013 CSOM or PowerShell
  • The remote server returned an error 407 Proxy Authentication Required error SharePoint Online Visual Studio 2015
  • Error occurred in deployment step ‘Install SharePoint Add-in’: The remote server returned an error: (503) Server unavailable

the remote server returned an error (403) forbidden SharePoint 2013/2016 client object model

If you are using client object model code to connect to SharePoint 2013 or SharePoint 2016, Then you can use the NetworkCredential class to pass the network credentials inside the object model code.

Below is the full piece code:

private void GetSiteDetails()
{
using (ClientContext context = new ClientContext("http://mypc/sites/MySP2016SiteCollection/"))
{
context.Credentials = new NetworkCredential(@"MYSPAdministrator", "Qwe@12345");
Web web = context.Web;
context.Load(web);
context.ExecuteQuery();
lblResult.Text = web.Title;
}
}

Here we are passing the network credentials in the NetworkCredential class. Now the error should not come.

The remote server returned an error: (403) Forbidden error in SharePoint client object model console application

If you are trying to connect to SharePoint on-premise site using .Net managed client object model code, then you can write like below to pass the username, password and domain.

using (ClientContext context = new ClientContext("https://SiteURL"))
{
context.AuthenticationMode = ClientAuthenticationMode.Default;
context.Credentials = new NetworkCredential("username", "password", "domain");
Web web = context.Web;
context.Load(web);
context.ExecuteQuery();
}

Basically to resolve The remote server returned an error: (403) Forbidden error, you can pass the credentials to the client context like below:

NetworkCredential credentials =new NetworkCredential("username", "password", "domain");
context .Credentials = credentials;
Or you can also write like below:
context.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;

Then The remote server returned an error: (403) Forbidden error will not appear.

The remote server returned an error: (500) Internal Server Error.

In this SharePoint CSOM tutorial, we will discuss how to resolve the issue which comes in SharePoint 2013/2016 “the remote server returned an error 500 internal server error. sharepoint client object model”.

We were working in SharePoint 2016 client object in a console application where we received the below error:

An unhandled exception of type ‘System.Net.WebException’ occurred in System.dll

Additional information: The remote server returned an error: (500) Internal Server Error.

The remote server returned an error: (500) Internal Server Error
The remote server returned an error: (500) Internal Server Error

The remote server returned an error: (500) Internal Server Error

We wrote the below code to retrieve SharePoint site details using CSOM code.

private void GetSiteDetails()
{
using (ClientContext context = new ClientContext("http://mypc/sites/MySP2016SiteCollection/"))
{
context.AuthenticationMode = ClientAuthenticationMode.Default;
context.Credentials = new NetworkCredential(@"MYSPAdministrator", "Qwe@12345");
Web web = context.Web;
context.Load(web);
context.ExecuteQuery();
lblResult.Text = web.Title;
}
}

To connect to SharePoint 2016 site from the client-side object model, we need to provide credentials that we have provided in the below line which is perfect. Here http://mypc/sites/MySP2016SiteCollection/ was my SharePoint on-premise 2016 site.

context.Credentials = new NetworkCredential(@"MYSPAdministrator", "Qwe@12345");

But the error was coming because of the below line:

context.AuthenticationMode = ClientAuthenticationMode.Default;

So I have modified the CSOM code like below to resolve the issue.

private void GetSiteDetails()
{
using (ClientContext context = new ClientContext("http://mypc/sites/MySP2016SiteCollection/"))
{
context.Credentials = new NetworkCredential(@"MYSPAdministrator", "Qwe@12345");
Web web = context.Web;
context.Load(web);
context.ExecuteQuery();
lblResult.Text = web.Title;
}
}

Still, if you are getting the above error, then try to change the account name, instead of using an Administrator account. So you can pass like below:

context.Credentials = new NetworkCredential(@"MYSPBijay", "Qwe@12345");

This is how to fix the error, the remote server returned an error 500 internal server error which comes while working with the managed object model in SharePoint 2019/2016/2013.

You may like the following SharePoint client object model tutorials:

  • Delete All items from the SharePoint List using PnP core CSOM Library Programmatically
  • Get all Subsites in Site collection programmatically using PnP core CSOM Library in SharePoint Online/2016/2013
  • Create Folder and Subfolder in SharePoint Document Library using PnP Core CSOM Library
  • SharePoint create workflow history list programmatically using client-side object model code (csom)
  • The file is not checked out. You must first check out this document before making changes SharePoint 2013 CSOM
  • SharePoint online Delete list programmatically using CSOM C#.Net managed object model code

I hope this SharePoint tutorial helps to resolve the remote server returned an error (403) forbidden SharePoint client object model, the remote server returned an error (403) forbidden SharePoint or clientcontext executequery () the remote server returned an error 403 forbidden error in SharePoint Online/2016/2013.

Bijay Kumar

I am Bijay a Microsoft MVP (8 times – My MVP Profile) in SharePoint and have more than 15 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com

Following is the code I am using to get analytics data:

//Code Start
AnalyticsService asv = new AnalyticsService("Data Export");
asv.setUserCredentials("MyUsername", "MyPassword");
String baseUrl = "https://www.google.com/analytics/feeds/data";
DataQuery query = new DataQuery(baseUrl);
query.Ids = "MyClientAnalytic ID";
query.Dimensions = "ga:pagePath,ga:date";
query.Metrics = 
"ga:pageviews,ga:uniquePageviews,ga:timeOnPage,ga:bounces,ga:entrances,ga:exits"
;
query.Filters = "ga:medium==referral";
query.Sort = "-ga:pageviews";
query.NumberToRetrieve = 10000;
query.GAStartDate = "2012-01-07";
query.GAEndDate = "2013-01-07";
Uri url = query.Uri;

System.Diagnostics.Debug.WriteLine("URL: " + url.ToString());

// Send our request to the Analytics API and wait for the results to come back.
DataFeed feed = asv.Query(query);
//Code End


The above code was always working until recently I started getting this 
exception :


"System.Net.WebException : The remote server returned an error: (403) Forbidden"



I am going through all the answers (in the link : 
http://code.google.com/p/google-gdata/issues/detail?can=2&start=0&num=100&q=&col
spec=ID%20Type%20Status%20Owner%20Summary&groupby=&sort=&id=613 )but I m not 
sure how I can incorportate the solution provided by noemi.mo...@red-gate.com 
(#7) which says(I have no idea what he/she meant?):

"All I had to do is register in the project in the Google APIs console and use 
the API Key on my request and is now working fine again"


Also the solution provided by braintec...@gmail.com (#9)(I have no idea what 
he/she meant either?):

"It's working by changing the _autoPostData value to 
"�?accountType=HOSTED_OR_GOOGLE&Email={0}&Passwd={1}&service=analytics&sour
ce=thecyberwizard.comâ"

I am getting the results on https://ga-dev-tools.appspot.com/explorer/ and 
https://code.google.com/oauthplayground/ with all the same input values that I 
am sending through the code. Please help me.

Original issue reported on code.google.com by aa...@webqa.net on 5 Feb 2013 at 10:38

Почему появляется эта проблема

Вначале разберем виды неисправности с ошибкой 403 Forbidden:

    • Forbidden: You don’t have permission to access [directory] on this server.
      Доступ запрещён: У вас нет прав для доступа к [каталогу] на этом сервере.
    • HTTP Error 403 – Forbidden.
      HTTP Ошибка 403 – Доступ запрещён.
    • 403 forbidden request forbidden by administrative rules.
      403 Доступ запрещён администратором.
    • 403 Forbidden – Access is denied.
      403 Доступ запрещён.

Главной проблемой становятся неверные разрешения файлов, либо неверные настройки в расширении .htacces. Она появляется в результате того, что пользователь не имеет прав к той информации которую хочет видеть.

Подобное сообщение говорит о том, что пользователь хотел получить доступ к элементам Nginx, на которые было наложено ограничение со стороны вебмастера в конфигурационных файлах сервера. Еще одна вероятная причина отказа – ваш IP находится в черном списке сервера.

Исправляем ошибку у вебмастера

Проверяем .htaccess

Если проблема возникла со стороны вебмастера, то искать ответ на решение задачи следует в проверке правильных путей к страницам, к которым запрашивается доступ. Рекомендуется проверить верно ли их расположение на хостинге. Они чаще всего располагаются в папке public_html. Не забудьте посмотреть документацию на сайте провайдера. В ней указывается, где располагаются эти файлы.Файл .htaccess

Теперь перейдем к файлу htaccess. Он может быть скрыт. Для того, чтоб отыскать его необходимого включить показ скрытых элементов. В настройках надо отметить «Показать скрытые файлы» (dotfiles).Параметры папки

Теперь рекомендуется загрузить .htaccess на компьютер, а элемент на хостинге уничтожить. Затем перезалить его. Если после данной операции, сайт откроется без ошибок, то значит вы сделали все правильно. Этот файл был поврежден.

Настраиваем права доступа

Если первая операция не помогла устранить неисправность, то переходим к настройке прав доступа. Когда вы создаете файл ему автоматически присваиваются определенные права. Иногда их все-таки нужно изменить.

Для изменения работайте в файловом менеджере или FTP клиент. Нужно подключиться к странице посредством клиента, зайти в каталог public_html, выбрать название страницы ПКМ и нажать на «атрибуты файла».

Атрибуты файла

Затем необходимо отметить «применить только к каталогам». Затем вводите значение 755. Кликните кнопку «Ок». После процедуры, повторите операцию с атрибутами файла снова, но теперь проставьте правило 644.Изменение прав доступа

Теперь откройте страницу. Если не открывается, то переходим к следующему пункту.

Отключаем плагины на WordPress

Если решения нет, значит обратите внимание на плагины. Возможно они повреждены или несовместимы, рекомендуется их отключить. Снова используем FTP клиент и входим в каталог public_html. Теперь находим wp-content и открываем. Переименовываем папку с именем plugins в plugins off. Для облегчения их нахождения.Отключение плагинов

Если сайт открылся значит один или несколько, или вообще все плагины повреждены. Отключайте по очереди, чтобы узнать какой именно. Затем свяжитесь с провайдером, чтобы заменить его.

Неправильный файл index

Если проблема не решилась, то возможно неправильный сам файл index. Необходимо проверить правильность его написания. Все буквы напишите в нижнем регистре. Например, index.html. Неправильный пример – Index.Html.

Ошибка из-за DNS кеша

Если с индексом все нормально, то проблемы могут быть с DNS кешем. Это значит, что хостинг не успел обновить информацию. Рекомендуется немного подождать. Обычно около нескольких часов.

Если со стороны вебмастера все нормально, то проблема на стороне пользователя.

Ошибка у пользователя

Ключевая ошибка, которую делает пользователь

Пользователь в этом случае должен проверить правильное ли имя указывает в адресной строке. Многие каталоги защищены от просмотра, поэтому есть возможность, что в адресной строке вы указываете ссылку на каталог, а не на страницу сайта.

Чистка кеша и куки браузера

Для решения неисправности можно попробовать почистить кеш браузера. Так как кешированная версия может тоже привести к появлению подобного сообщения. Либо почистите куки. Если проблема не уходит, необходимо связаться с администраторами сайта. Возможно такая проблема возникает у всех пользователей, а разработчики об этом не знают.

Черный список

Если сайт работает у других нормально, то значит ваш IP внесен в черный список и заблокирован. Вы не сможете просматривать этот сайт. Необходимо связаться с провайдером или обратиться в техническую поддержку сайта, для решения проблемы.

composs.ru

Я написал приложение, которое хорошо работало в течение многих месяцев за последние несколько дней, я получал ошибку ниже на установленной версии только.

Если я бегу, исходный код в ПРОТИВ всего хорошо работает. Кроме того, .exe в папках мусорного ведра хорошо работают. Это — только установленная версия, которая производит ошибку, если я повторно собираю и повторно устанавливаю, я получаю ту же самую ошибку.

Я немного озадачен относительно того, что вызывает это и надеялось на несколько указателей. Это, кажется, ответ WebRequest через IE, не возвращается, но я озадачен относительно того, почему это хорошо работает в ПРОТИВ без любых ошибок. Есть ли какие-либо новые меры безопасности IE/полицейские, которые могут вызвать это?

Вещи, которые я попробовал до сих пор, включают:

  • Disabled all AntiVirus & Firewall
  • Run as Administrator

Исключение:

Exception: System.Windows.Markup.XamlParseException: The invocation of the constructor on type 'XApp.MainWindow' that matches the specified binding constraints threw an exception. ---> System.Net.WebException: The remote server returned an error: (403) Forbidden.  at System.Net.HttpWebRequest.GetResponse()  at XApp.HtmlRequest.getHtml(Uri uri) in J:PathMainWindow.xaml.cs:line 3759  at XApp.MainWindow.GetLinks() in J:PathMainWindow.xaml.cs:line 2454  at XApp.MainWindow..ctor() in J:PathMainWindow.xaml.cs:line 124  --- End of inner exception stack trace ---  at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)  at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)  at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)  at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc)  at System.Windows.Application.LoadComponent(Uri resourceLocator, Boolean bSkipJournaledProperties)  at System.Windows.Application.DoStartup()  at System.Windows.Application.<.ctor>b__1(Object unused)  at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)  at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) Exception: System.Net.WebException: The remote server returned an error: (403) Forbidden.  

t System.Net.HttpWebRequest.GetResponse() at XApp.HtmlRequest.getHtml(Uri uri) in J:PathMainWindow.xaml.cs:line 3759 at XApp.MainWindow.GetLinks() in J:PathMainWindow.xaml.cs:line 2454 at XApp.MainWindow..ctor() in J:PathMainWindow.xaml.cs:line 124

Править:

Это устанавливается как автономное приложение. Когда я бежал как Администратор, я открыл папку программы и управляю exe как администратор, а не короткий путь.

Кодекс, который вызывает проблему, является этим

private void GetLinks() {  //Navigate to front page to Set cookies  HtmlRequest htmlReq = new HtmlRequest();   OLinks = new Dictionary>();   string Url = "http://www.somesite.com/somepage";  CookieContainer cookieJar = new CookieContainer();  HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Url);  request.CookieContainer = cookieJar;   request.Accept = @"text/html, application/xhtml+xml, */*";  request.Referer = @"http://www.somesite.com/";  request.Headers.Add("Accept-Language", "en-GB");  request.UserAgent = @"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)";  request.Host = @"www.somesite.com";   HttpWebResponse response = (HttpWebResponse)request.GetResponse();  String htmlString;  using (var reader = new StreamReader(response.GetResponseStream()))  {  htmlString = reader.ReadToEnd();  }   //More Code    }   

switch-case.ru

У вас именно решение Captcha запрашивается при обращении к скриптам API, что через браузерную строку, что при программном обращении. Так что ваше апи теперь не работоспособно. Капчу значит WAF и вызывает. Вы говорите что у вас нет Captcha, я же говорю что последние 2 дня у вас капча при запросах к апи.

Решаешь капчу пролучаешь ответ API, не решаешь получаешь 403 ошибку. Как вам еще доказать что ваше апи теперь неработоспособно и что бы вы исправили ситуацию, я не знаю. Вот попробуйте запрос на баланс с моим ключом http://api.sms-reg.com/getBalance.php?a … qbhw4v9rjo, хоть из браузера, хоть из любого другого места.

Вот скрины где видно что это captcha:
Скрин при обращении из браузера, в строке url забит запрос к апи на получение баланса :
https://s.mail.ru/BUMa/XYp43njAH

Скрин при обращении на php тоже на баланс
https://s.mail.ru/EA5p/ciWsygcBK

На c# через webclient просто 403 ошибку выдает.

Надеюсь вы прислушайтесь к моему сообщению и исправите ситуацию, а не будете мне просто говорить что при вызове Api у вас нет Captca. Когда она есть. И как не странно captca в АПИ стала появляться ровно тогда, когда вы подключили к своему сайту (не знаю как это правильно называется), но суть такая когда заходишь на ваш сайт, то вылазит страница где просят подтвердить что я не робот. Вот эта штука теперь еще и блокирует запросы к апи и выдает проверку что я не робот. До этого у вас была какая то другая штука при заходе на сайт, и апи работало. Хотя Апи для того и предназначен что бы к нему обращались программно. Вы так же можете проигнорировать мой пост и дальше считать что у вас все в порядке, ваше право.

Я хочу помочь и вам и себе, что бы люди с помощью вашего сервиса могли регистрировать аккаунты соц сетей в моем софте. Но если мне не получиться решить данную ситуацию и ваше апи так и будет не работоспособным. Будет очень жаль, но есть еще как минимум несколько подобных сервисов где апи доступно и не блокируется капчой. Спасибо за понимание и надеюсь на исправление ситуации

forum.sms-reg.com

Понравилась статья? Поделить с друзьями:
  • System net http httprequestexception an error occurred while sending the request
  • System launcher ошибка загрузки xiaomi
  • System language adaptation fail access denied как исправить
  • System information was not obtained because of msinfo32 execution error перевод
  • System indexoutofrangeexception как исправить