Problems implementing Tinder API in vb .net

Hello

I am just trying to toy around with the Tinder API, I've found the following link describing the tinder API:
https://gist.github.com/rtt/10403467

When I try the Authenticating function, I get a 403 Forbidden Error with the following vb.net code:
Dim wHeader As WebHeaderCollection = New WebHeaderCollection()

        wHeader.Clear()
        'wHeader.Add("Content-type: application/json")
        'wHeader.Add("User-agent: User-Agent: Tinder/3.0.4 (iPhone; iOS 7.1; Scale/2.00)")
        wHeader.Add("facebook_token: ####")
        wHeader.Add("facebook_id: 1391287###")

        Dim sUrl As String = "https://api.gotinder.com/auth"

        Dim wRequest As HttpWebRequest = DirectCast(System.Net.HttpWebRequest.Create(sUrl), HttpWebRequest)

        wRequest.ContentType = "application/json"
        wRequest.UserAgent = "Tinder/3.0.4 (iPhone; iOS 7.1; Scale/2.00)"
        wRequest.Headers = wHeader
        wRequest.Method = "GET"
        Try
            Dim wResponse As HttpWebResponse = DirectCast(wRequest.GetResponse(), HttpWebResponse)
            Dim sResponse As String = ""
            Using srRead As New StreamReader(wResponse.GetResponseStream())
                sResponse = srRead.ReadToEnd()
            End Using
            MsgBox(sResponse)
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try

Open in new window

You can get your facebook token from here:
https://www.facebook.com/dialog/oauth?client_id=464891386855067&redirect_uri=https://www.facebook.com/connect/login_success.html&scope=basic_info,email,public_profile,user_about_me,user_activities,user_birthday,user_education_history,user_friends,user_interests,user_likes,user_location,user_photos,user_relationship_details&response_type=token
and you can find your facebook id with the following website:
http://findmyfacebookid.com/

What am I doing wrong, is the API changed or am I doing something wrong in my .net code?
JoachimPetersenAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
I don't have any experience with the Tinder API, so I will need to figure out how the OAuth piece works. If you are passing Facebook ID and Facebook token, and hitting the correct URL (api.gotinder.com/auth), then it sounds like it is going to be more challenging.
Bob LearnedCommented:
A few of the reasons that I don't like Tinder:

A brilliant Tinder hack made hundreds of bros unwittingly flirt with each other
http://www.theverge.com/2015/3/25/8277743/tinder-hack-bros-swiping-bros
JoachimPetersenAuthor Commented:
Well, granted that any API can be misused, there is also a lot more potential in a constructive perspective.
I think I'll just have to sniff the app and see if the API has changed, as far as I can understand, my .net code is not the source of the error.
OWASP: Threats Fundamentals

Learn the top ten threats that are present in modern web-application development and how to protect your business from them.

Bob LearnedCommented:
I see where you are using the version in the user agent:

wRequest.UserAgent = "Tinder/3.0.4 (iPhone; iOS 7.1; Scale/2.00)"

I also see that there is a 4.0.4 version.
JoachimPetersenAuthor Commented:
Found out that the API has changed, ALOT (sniffed out the data and found the new parameters) , but the problem I am facing now is that when I try to set an header, ie: Content-Type, I get the following error: "The Content-Type header cannot be changed from its default value for this request.", any idea how I cound fix this, as this is an actual 'code' question
System.Net.ServicePointManager.CertificatePolicy = new MyPolicy(); //To sign the SS to avoid error
      
            string URL = "https://api.gotinder.com/auth";
            WebClient webClient = new WebClient();
            //webClient.Headers[HttpRequestHeader.ContentType] = "application/json";
            //webClient.Headers["Content-Type"] = "application/json";
            //webClient.Headers.Set("Content-Type", "application/json");
            //When I try to change the content-type at this point, I end up with this error "The Content-Type header cannot be changed from its default value for this request."
            webClient.Headers[HttpRequestHeader.UserAgent] = "Tinder Android Version 4.1.6";
            System.Collections.Specialized.NameValueCollection formData = new System.Collections.Specialized.NameValueCollection();
            formData["facebook_token"] = "***Facebook Token***";
            formData["locale"] = "da";
            byte[] responseBytes = webClient.UploadValues(URL, "POST", formData);
            string Result = Encoding.UTF8.GetString(responseBytes);

            textBox1.Text = Result;

Open in new window

Here is the MyPolicy to sign the SSL to avoid any SSL errors:
using System.Security.Cryptography.X509Certificates;
using System.Net;

public class MyPolicy : ICertificatePolicy
{
    public bool CheckValidationResult(ServicePoint srvPoint,
      X509Certificate certificate, WebRequest request,
      int certificateProblem)
    {
        //Return True to force the certificate to be accepted.
        return true;
    }
}

Open in new window

Bob LearnedCommented:
You can't set Content-type with UploadValues, you  would need to use UploadData instead.
JoachimPetersenAuthor Commented:
needed different parameters

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JoachimPetersenAuthor Commented:
figured it out myself
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.