• FirefoxUpgrade to the new Firefox »
  • Locations

    Text Size: A A A

    Save to My Help

    Save this article to My Help for easy reference. You can visit the article at any time from any computer.

    Replace an article

    You have reached the maximum number of saved articles. Your oldest saved article will be replaced with the new one.

    Web Services accounts are distributed across various colocations. To send a request to the Web Services, you must include the URL that identifies the colocation the account is assigned to.

    Introduction

    To enhance performance, Web Services accounts are distributed across various colocations. When you sign up with Web Services, your account, and all accounts you subsequently create, are assigned to one of these colocations.

    When you send a Web Services request, you must include the URL that identifies the colocation for the account on whose behalf the operation is performed. This URL, referred to as a local URL, is formed by combining a URL prefix with the current version and the service name.

    Process

    To form a local URL:

    • First, send a request to the LocationService to retrieve the URL prefix for the colocation the account is assigned to. You can make the request for your account or for one of the accounts you manage.
    • Next, combine the URL prefix with the current version and the service name to form a complete, local URL (URL prefix / version / service).
    • Then, send a request to the named service using the local URL.

    Note: When you send a request to the LocationService, do not use a local URL. Rather, use the URL located in the LocationService (sandbox or production) WSDL file.

    Before making a request for an account, send a request to the LocationService to determine the account colocation. Once you have the URL prefix, you can use it to create multiple local URLs for multiple service requests.

    Example

    Suppose, for a specific account, you want to send requests to SiteService and ReportService, your client application would need to perform the following tasks:

    1. Create and send a request to the LocationService using the URL located in the LocationService WSDL file. Process the response and retrieve the URL prefix for the colocation the account is assigned to.
    2. Use the URL prefix to form a local URL (URL prefix / version / SiteService). Create and send the request to the SiteService using the local URL. Process the response.
    3. Use the URL prefix to form a local URL (URL prefix / version / ReportService). Create and send the request to the ReportService using the local URL. Process the response.

    Note: Your request must include the credentials of the account, on whose behalf you are making the request, in the header.

    Summary

    To summarize:

    • To send a request to the LocationService, use the URL located in the LocationService (sandbox or production) WSDL file.
    • To send a request to all other services, use the local URL. To form the local URL, send a request to the LocationService to retrieve the URL prefix for the colocation of the account. Then, combine the URL prefix with the current version and the relevant service name to form a local URL.

    About LocationService

    Use the LocationService to return the URL prefix for the colocation the account is assigned to. Once you have the URL prefix, you can use it to form the local URL.

    LocationService Request

    The LocationService has one operation, getAccountLocation. In the request, enter your credentials and the account ID. Post the request using the URL located in the LocationService WSDL file.

    See EWS Requests for more information.

       POST
       https://global.apt.yahooapis.com/services/V2/LocationService
       HTTP/1.0
       Content-Type: text/xml; charset=utf-8
       Content-Length: 987
    
       <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
       	xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext"
       	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
       	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       	xmlns="http://apt.yahooapis.com/V2">
    
          <soap:Header>
             <wsse:Security>
               <wsse:UsernameToken>
                 <wsse:Username>user</wsse:Username>
                 <wsse:Password>password</wsse:Password>
               </wsse:UsernameToken>
             </wsse:Security>
             <license>35cf33e7-5ad1-3aa9-0593-346681f64eb0</license>
             <accountID>9901672</accountID>
          </soapenv:Header>
    
          <soapenv:Body>
             <getAccountLocation/>
          </soapenv:Body>
    
       </soapenv:Envelope>
    

    LocationService Response

    The LocationService returns the URL prefix for the colocation the account is assigned to. For example: "https://colo2.apt.yahooapis.com/services".

    See EWS Responses for more information.

       <?xml version='1.0' encoding='UTF-8'?>
    
       <soap:Envelope
            xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
          	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
            xmlns="http://apt.yahooapis.com/V2">
    
             <soap:Header>
                <remainingQuota>9999974</remainingQuota>
                <commandGroup>Creatives</commandGroup>
                <timeTakenMillis>2813</timeTakenMillis>
             </soap:Header>
    
             <soap:Body>
                <getAccountLocationResponse>
                   <out>
                      https://colo2.apt.yahooapis.com/services
                   </out>
    	    </getAccountLocationResponse>
             </soap:Body>
    
       </soap:Envelope>

    Combine the URL prefix with the current version and the specific service name to form a local URL (URL prefix + version + service). For example:

    • To send a request to the SiteService, the local URL would be
      "https://colo2.apt.yahooapis.com/services/V2/SiteService"
      .
    • To send a request to the LibraryImageAdService, the local URL would be
      "https://colo2.apt.yahooapis.com/services/V2/LibraryImageAdService".

    Requests and HTTPS

    Web Services requests must be sent using the POST method over HTTPS. For more information about how to construct and send requests, see Hypertext Transfer Protocol.

    Note: Web Services do not require a value for the SOAPAction HTTP header. If your toolkit requires the use of this header, you may leave it blank.

    This example shows how to send a Web Services request to the SiteService. Notice that the request uses the local URL.

       POST
       https://colo2.apt.yahooapis.com/services/V2/SiteService
       HTTP/1.0
       Content-Type: text/xml; charset=utf-8
       Content-Length: 987
    
       <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
       	xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext"
       	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
       	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       	xmlns="http:/apt.yahooapis.com/V2">
    
          <soapenv:Header>
             <wsse:Security>
               <wsse:UsernameToken>
                 <wsse:Username>user</wsse:Username>
                 <wsse:Password>password</wsse:Password>
               </wsse:UsernameToken>
             </wsse:Security>
             <license>35cf33e7-5ad1-3aa9-0593-346681f64eb0</license>
             <accountID>9901673</accountID>
          </soapenv:Header>
    
          <soapenv:Body>
             <getSites>
                <siteIDs>
                   <long>5354501</long>
                   <long>5355001</long>
                </siteIDs>
             </getSites>
          </soapenv:Body>
    
       </soapenv:Envelope>

    Was this information helpful?      

    My Help

    Forgot your ID or password?

    Sign In

    Sign in to see your account information saved articles and more.
    1. Recent Searches (0)

    2. Saved Articles