none
Client Credentials in query string

    Question

  • Hi,

    I am trying to use Bing Synonym API V2. Usual authentication is through http basic. Can I send the client credentials in the query string? 

    For e.g. AzureAPIURL/Bing/Synonyms/GetSynonyms?Query=%27vip%27&ClientId=abcd&AppKey=1234

    Thanks in advance.

    • Edited by RC Learner Saturday, September 14, 2013 1:20 AM
    Saturday, September 14, 2013 1:17 AM

Answers

  • Hi RC,

    Thanks for posting!
    From my experience, if we add this message in query, I guess it may not works. When we use the azure data market data, we need send our User_ID and Key using DataServiceContext.

    public static BingSynonymsContainer createConnection(String USER_ID, String KEY) 
            {
                USER_ID = "your ";
                KEY = "";
                context = new BingSynonymsContainer(new Uri("https://api.datamarket.azure.com/Bing/Synonyms/v1/GetSynonyms"));
                context.IgnoreMissingProperties = true;
                context.Credentials = new NetworkCredential(USER_ID, KEY);
                return context;
            
            }

    And BingSynonymsContainer class can be download from this Path:https://datamarket.azure.com/dataset/bing/synonyms

    And also you can refer to this link:http://msdn.microsoft.com/en-us/library/gg193417.aspx 

    Thanks.


    Will
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, September 16, 2013 10:18 AM
    Moderator

All replies

  • Hi RC,

    Thanks for posting!
    From my experience, if we add this message in query, I guess it may not works. When we use the azure data market data, we need send our User_ID and Key using DataServiceContext.

    public static BingSynonymsContainer createConnection(String USER_ID, String KEY) 
            {
                USER_ID = "your ";
                KEY = "";
                context = new BingSynonymsContainer(new Uri("https://api.datamarket.azure.com/Bing/Synonyms/v1/GetSynonyms"));
                context.IgnoreMissingProperties = true;
                context.Credentials = new NetworkCredential(USER_ID, KEY);
                return context;
            
            }

    And BingSynonymsContainer class can be download from this Path:https://datamarket.azure.com/dataset/bing/synonyms

    And also you can refer to this link:http://msdn.microsoft.com/en-us/library/gg193417.aspx 

    Thanks.


    Will
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, September 16, 2013 10:18 AM
    Moderator
  •  Dim BingCont As New BingSynonyms.BingSynonymsContainer(New Uri("http://api.datamarket.azure.com/Bing/Synonyms/v1/GetSynonyms"))
            BingCont.IgnoreMissingProperties = True
             
            Dim sss As String
             
            BingCont.Credentials = New NetworkCredential("ClientID", "SecretKey")
            Dim obj As Data.Services.Client.DataServiceQuery(Of GetSynonymsEntitySet) = BingCont.GetSynonyms("gandhi")
            '  Dim allvalue = From Synonyms In obj Select Synonyms
            Try
                For Each x As GetSynonymsEntitySet In obj
                    MsgBox(x.Synonym.ToString)
                Next
            Catch ex As Exception
                MsgBox(ex.InnerException.Message)
            Finally
                ' InputBox("", "", obj.GetType.ToString)
            End Try
    It did not work either :( :(
    Wednesday, March 02, 2016 8:39 PM