Jump to content

Help working with an API


Recommended Posts

I want to make an AutoIT script for an API using Winhttp.au3 udf. Before starting to code, I tried it in the browser. Here is the documentation of the API

First I tried the add remoteuploadurls method:

[b] addRemoteUploadUrls [i](login required)[/i][/b]
 
Remote Upload Urls
 
Assumed response fields:
- internal id
- url
 
Then, if you want, you can call the getRemoteUploadStatus method to get the progression
 
[b]@restriction[/b] Do not send more then 100 urls at a time
                Make sure the "urls" param is sent via POST, else you might get server error (too long url)
 
[b]@see[/b] [url="http://api.wupload.com/user#FSApi_Auth-login"]FSApi_Auth::login[/url]
 
[b]@return[/b] Array
 
[b]@example[/b]  http://api.wupload.com/upload?method=addRemoteUploadUrls&u=USER-EMAIL&p=PASSWORD&urls[]=

I tried using this:

[/u] http://api.wupload.com/upload?method=addRemoteUploadUrls&u=MYUSER&p=MYPASS&urls[]=http://www.wu***ad.com/file/****584611/whatever.part01.rar&http://www.wupload.com/file/653******16/whatever.part02.rar

and I received this response:

<FSApi_Upload>

<addRemoteUploadUrls>

<response>

<items>

<item>

<id>66737739261326d*********0da65d33c0c19</id>

<url>

http://www.wupload.com/file/6******611/whatever.part01.rar

</url>

</item>

</items>

</response>

<status>success</status>

</addRemoteUploadUrls>

</FSApi_Upload>

It's strange that only the first link was processed, maybe I can't concatenate links with '&' and should use ','

But the main problem is the response of get remote upload status:

Following the instructions:

[b] getRemoteUploadStatus [i](login required)[/i][/b]
 
Get Remote Upload Status
 
Assumed response fields:
- items
    - item
        - id (internal id)
        - url (sent by the user)
        - status (IN_QUEUE, DOWNLOADING, WAITING_STORAGE, COMPLETED, ERROR)
        - status_detail (available only in case of status ERROR)
        - progress_percent (available only in case of status DOWNLOADING)
        - wupload (available only when the file is ready to download with status WAITING_STORAGE or COMPLETED)
            - url (the url to download from wupload)
            - the link id
 
[b]@restriction[/b] Make sure the "ids" param is sent via POST, else you might get server error (too long url)
 
[b]@see[/b] [url="http://api.wupload.com/user#FSApi_Auth-login"]FSApi_Auth::login[/url]
 
[b]@return[/b] Array
 
[b]@example[/b] http://api.wupload.com/upload?method=getRemoteUploadStatus&u=USER-EMAIL&p=PASSWORD&ids[]=

I tried this:

http://api.wupload.com/upload?method=getRemoteUploadStatus&u=MYUSER&p=MYPASS&ids[]=66737739261326d*************ee0da65d33c0c19
(I put the same id that was returned previously---> <id>66737739261326d*********0da65d33c0c19</id> )

and I received this response:

<FSApi_Upload>

<getRemoteUploadStatus>

<response>

<items>

<item>

<id>66737739261326d*************e0da65d33c0c19</id>

<url>

http://www.wu***ad.com/file/6*****611/whatever.part01.rar

</url>

<status>ERROR</status>

<filename>whatever.part01.rar</filename>

<status_detail>

User/Pass Invalid or plugin for that site temporarily unavailable

</status_detail>

</item>

</items>

</response>

<status>success</status>

</getRemoteUploadStatus>

</FSApi_Upload>

I don't understand what went wrong since the files were online. When I checked the account, the file wasn't uploaded at all. Another thing I would like to know is when using methods like getRemoteUploadStatus, do I have to loop asking each time? if so, is there a limit between requests so as to avoid being rejected by the server?

I ask here because the only way with that site is by the contact form and I hope an experienced member with APIs can help.

Thanks for your help!

Edited by Mithrandir
Link to comment
Share on other sites

I can understand your desire to get attention of people you think that could help you. Still that doesn't mean you should abuse the system.

Moved to more appropriate general help forum.

Sorry for posting in the wrong section, I thought that since it's not an autoit related question, it should go in developer and c++ geeks talk :graduated: like this thread:

But again, I don't want to draw the attention, even though I would appreciate some help as always. Thanks for moving the thread to the appropriate section!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...