Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Http_post request to an api at ebay

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Http_post request to an api at ebay

    The xml code works OK when using eBay's api test tool but two days of frustration using HTTP_POST_PAGE2(), HTTP_POST() and HTTP_FETCH(), and reading a lot, must end while I still have hair. Please can somebody point me in the right direction and give me some sample code for posting to ebay

    #2
    Re: Http_post request to an api at ebay

    What code do you have so far and what is the error you are getting?

    Lenny Forziati
    Vice President, Internet Products and Technical Services
    Alpha Software Corporation

    Comment


      #3
      Re: Http_post request to an api at ebay

      this is the alpha script with AppID and <aBayAuthToken> removed

      trace.Clear()
      DIM string as c
      DIM header as c
      DIM outcome[20] as c
      string=<<%str%
      X-EBAY-API-APP-ID: AppID
      X-EBAY-API-SITE-ID: 3

      <?xml version="1.0" encoding="utf-8"?>
      <GetCategoriesRequest xmlns="urn:ebay:apis:eBLBaseComponents">
      <RequesterCredentials>
      <eBayAuthToken>---------------------</eBayAuthToken>
      </RequesterCredentials>
      <Version>657</Version>
      <CategorySiteID>3</CategorySiteID>
      <DetailLevel>ReturnAll</DetailLevel>
      <LevelLimit>1</LevelLimit>
      <ViewAllNodes>true</ViewAllNodes>
      </GetCategoriesRequest>
      %str%
      'trace.WriteLn(string)
      result=HTTP_POST_PAGE2("https://api.sandbox.ebay.com/ws/api.dll",string,.t.,45000)

      outcome[2]=extract_string(result,"<Timestamp>","</Timestamp>",1,.f.,.f.)
      trace.WriteLn(outcome[2])
      outcome[3]=extract_string(result,"<Ack>","</Ack>",1,.t.,.f.)
      trace.WriteLn(outcome[3])


      outcome[5]=extract_string(result,"<ShortMessage>","</ShortMessage>",1,.t.,.f.)
      trace.WriteLn(outcome[5])
      outcome[6]=extract_string(result,"<LongMessage>","</LongMessage>",1,.t.,.f.)
      trace.WriteLn(outcome[6])
      outcome[7]=extract_string(result,"<ErrorCode>","</ErrorCode>",1,.t.,.f.)
      trace.WriteLn(outcome[7])
      outcome[8]=extract_string(result,"<SeverityCode>","</SeverityCode>",1,.t.,.f.)
      trace.WriteLn(outcome[8])
      outcome[9]=extract_string(result,"<ErrorClassification>","</ErrorClassification>",1,.t.,.f.)
      trace.WriteLn(outcome[9])
      outcome[10]=extract_string(result,"<Build>","</Build>",1,.t.,.f.)
      trace.WriteLn(outcome[10])
      outcome[11]=substr(result,at("</GeteBay",result,1),30)
      trace.WriteLn(outcome[11])

      This is from the trace window

      2010-03-05 16:18:16
      <Ack>Failure</Ack>
      <ShortMessage>Unsupported API call.</ShortMessage>
      <LongMessage>The API call "GeteBayOfficialTime" is invalid or not supported in this release.</LongMessage>
      <ErrorCode>2</ErrorCode>
      <SeverityCode>Error</SeverityCode>
      <ErrorClassification>RequestError</ErrorClassification>
      <Build>10752342</Build>
      </GeteBayOfficialTimeResponse>

      Comment


        #4
        Re: Http_post request to an api at ebay

        Any thoughts yet Lenny - I am still no further on with this - ground to a halt - frustrated - need help

        Comment


          #5
          Re: Http_post request to an api at ebay

          the xml code works in the eBay API test tool so I know that bit is correct

          Is the inability of Alpha to connect to eBay 1)an Alpha problem, 2)an eBay problem or 3)my incorrect understanding of HTTP_FETCH()

          DEV NAME, APP NAME CERT NAME and TOKEN have been removed


          trace.Clear()
          DIM headerarray[10] as c
          headerarray[1]="X-EBAY-API-COMPATIBILITY-LEVEL: 657"
          headerarray[2]="X-EBAY-API-DEV-NAME: DEV NAME"
          headerarray[3]="X-EBAY-API-APP-NAME: APP NAME"
          headerarray[4]="X-EBAY-API-CERT-NAME: CERT NAME"
          headerarray[5]="X-EBAY-API-CALL-NAME: GetCategories"
          headerarray[6]="X-EBAY-API-SITEID: 3"
          headerarray[7]="Content-Type: text/xml"
          headerarray[8]=" "
          DIM headerinput as c
          headerinput=headerarray.dump()
          DIM string as c
          string=<<%str%
          <?xml version="1.0" encoding="utf-8"?>
          <GetCategoriesRequest xmlns="urn:ebay:apis:eBLBaseComponents">
          <RequesterCredentials>
          <eBayAuthToken>--TOKEN--</eBayAuthToken>
          </RequesterCredentials>
          <Version>657</Version>
          <CategorySiteID>3</CategorySiteID>
          <DetailLevel>ReturnAll</DetailLevel>
          <LevelLimit>1</LevelLimit>
          <ViewAllNodes>true</ViewAllNodes>
          </GetCategoriesRequest>
          %str%

          dim p as P

          p.host = "https://api.sandbox.ebay.com"
          p.ssl = .t.
          p.ssl_ValidateCert = .f.
          p.protocol="HTTP/1.1"
          p.method = "POST"
          p.body = string
          p.header = headerinput
          p.timeout = 45000
          p.SSL_0n = .f.
          p.page = "https://api.sandbox.ebay.com/ws/api.dll"
          result = http_fetch(p,.t.)
          trace.WriteLn(result.error_text)
          trace.WriteLn(str(result.error_code))
          trace.WriteLn(result.headers)
          trace.WriteLn(result.body)
          end

          trace window shows
          WSAHOST_NOT_FOUND - Host not found while getting host name..

          Detailed Description:
          No such host is known. The name is not an official host name or alias,
          or it cannot be found in the database(s) being queried.
          This error may also be returned for protocol and service queries,
          and means that the specified name could not be found in the relevant database.

          16037

          Comment


            #6
            Re: Http_post request to an api at ebay

            I am not familiar with the eBay API, so I can't comment on your use of it, but I see several problems with your use of http_fetch()

            p.host needs to be a hostname, not a URL. This is the cause of the error you are currently getting.
            Code:
            p.host = "api.sandbox.ebay.com"
            p.page should be a page, not a URL. Servers should support the syntax you are using, but not all do, so it is safer not to depend on it.
            Code:
            p.page = "/ws/api.dll"
            You have a typo in turning on SSL. I don't know if it is in your actual code, or just in your post here, but you have ssl_<zero>n. Additionally, you are setting it to false, when you seem to want to enable SSL. It should be:
            Code:
            p.SSL_on = .t.

            Lenny Forziati
            Vice President, Internet Products and Technical Services
            Alpha Software Corporation

            Comment


              #7
              Re: Http_post request to an api at ebay

              I am still getting an error message but you have moved me to a new level - communication is getting nearer

              Comment


                #8
                Re: Http_post request to an api at ebay

                Isn't it simple when you know the answer - it now communicates and sends back the information I want - thank you - the next task is to parse an xml file - ps and thanks to Steve for his interest

                Comment

                Working...
                X