AuthenticatedQuery() публичный Метод

Performs the query specified in the "query" string to perform a request that requires authorization.

This method requires that either an accessToken has been set manually or that the GetVerificationCode() and AuthenticateWithVerificationCode(string code) methods have been called previously.

It returns the IConsumerRequest fully enabled to make the request specified in the "query" string.

public AuthenticatedQuery ( string query ) : IConsumerRequest
query string The query string that will be added to the url and used to connect to the API with.
Результат IConsumerRequest
Пример #1
0
        // methods that DO require authentication:

        /// <summary>
        /// <para>Performs the Listing Method:
        /// Retrieve a list of unanswered questions for all listings belonging to a member,
        /// Retrieve a list of unanswered questions on a single listing,
        /// </para><para>
        /// using the "query" string provided - should be the  "Listings/questions/unansweredquestions.xml" part of the url.
        /// It shouldn't include "http://api.trademe.co.nz/v1/".
        /// </para>
        /// REQUIRES AUTHENTICATION.
        /// </summary>
        /// <param name="query">The query string that will be added to the base url and used to connect to the API.</param>
        /// <returns>Questions.</returns>
        public Questions UnansweredQuestionsByQueryString(string query)
        {
            var getRequest = _connection.AuthenticatedQuery(query);
            var xml        = getRequest.ToString();

            return(Deserializer <Questions> .Deserialize(new Questions(), xml));
        }
Пример #2
0
        /// <summary>
        /// <para>Performs the Fixed Price Offer Method:
        /// Retrieves a list of the outstanding fixed price offers that have been offered to the currently authenticated user. GET
        /// </para><para>
        /// using the "query" string provided - should be the  "MyTradeMe/FixedPriceOffers.xml" part of the url.
        /// It shouldn't include "http://api.trademe.co.nz/v1/".
        /// </para>
        /// REQUIRES AUTHENTICATION.
        /// </summary>
        /// <param name="query">The query string that will be added to the base url and used to connect to the API.</param>
        /// <returns>FixedPriceOffers.</returns>
        public FixedPriceOffers FixedPriceOffers(string query)
        {
            var getRequest = _connection.AuthenticatedQuery(query);
            var xml        = getRequest.ToString();

            return(Deserializer <FixedPriceOffers> .Deserialize(new FixedPriceOffers(), xml));
        }
Пример #3
0
        /// <summary>
        /// <para>Performs the Photo Method:
        /// Retrieve a list of member photos
        /// </para><para>
        /// using the "query" string provided - should be the  "Photos.xml" part of the url.
        /// It shouldn't include "http://api.trademe.co.nz/v1/".
        /// </para>
        /// REQUIRES AUTHENTICATION.
        /// </summary>
        /// <param name="query">The query string that will be added to the base url and used to connect to the API.</param>
        /// <returns>MemberPhotos.</returns>
        public MemberPhotos MemberPhotos(string query)
        {
            var getRequest = _connection.AuthenticatedQuery(query);
            var xml        = getRequest.ToString();

            return(Deserializer <MemberPhotos> .Deserialize(new MemberPhotos(), xml));
        }
Пример #4
0
        /// <summary>
        /// <para>Performs the Favourites Method:
        /// Get Saved Categories. GET
        /// </para>
        /// REQUIRES AUTHENTICATION.
        /// </summary>
        /// <returns>SavedCategories.</returns>
        public SavedCategories RetrieveFavouriteCategories()
        {
            var query = String.Format("{0}/{1}{2}", Constants.FAVOURITES, Constants.CATEGORIES, Constants.XML);

            var getRequest = _connection.AuthenticatedQuery(query);
            var xml        = getRequest.ToString();

            return(Deserializer <SavedCategories> .Deserialize(new SavedCategories(), xml));
        }
Пример #5
0
        /// <summary>
        /// <para>Performs the My Trade Me Method:
        /// Retrieve a list of lost items GET
        /// </para><para>using the "query" string provided - should be the  "MyTradeMe/Lost.xml" part of the url.
        /// It shouldn't include "http://api.trademe.co.nz/v1/".
        /// </para>
        /// REQUIRES AUTHENTICATION.
        /// </summary>
        /// <param name="query">The query string that will be added to the base url and used to connect to the API with.</param>
        /// <returns>Listings.</returns>
        public Listings LostItems(string query)
        {
            var getRequest = _connection.AuthenticatedQuery(query);
            var xml        = getRequest.ToString();

            return(Deserializer <Listings> .Deserialize(new Listings(), xml));
        }