Thread Tools Display Modes
Prev Previous Post   Next Post Next
02-04-15, 05:22 PM   #1
Cairenn
Credendo Vides
 
Cairenn's Avatar
Premium Member
WoWInterface Admin
Join Date: Mar 2004
Posts: 7,134
WoWInterface AddOn update API

How to use the WoWIinterface API via Curl:

API Token method:
Generate your API token here.
  • Keep this token private as it has access to submit updates to your AddOn via our API.
  • Delete the token at any time to revoke its access to your AddOns
  • Team members can generate their own api token, no need to share yours.

GET AddOns you have access to:
Code:
curl -H "x-api-token: <Your Token>" https://api.wowinterface.com/addons/list.json
GET AddOn details:
Code:
curl -H "x-api-token: <Your Token>" https://api.wowinterface.com/addons/details/<id>.json
POST Updates: (If you GET the endpoint it will list what can be changed via this endpoint)
Code:
curl -H "x-api-token: <Your Token>" -F "id=8163" -F "version=123456789" -F "compatible=6.0.3" -F "updatefile=@/Users/dolby/Downloads/test2.zip" https://api.wowinterface.com/addons/update
List of valid data you can POST:
Just do a GET on http://api.wowinterface.com/addons/update and you’ll receive an error with a list of valid data points.


Cookie method (legacy):


Make a cookie file to authenticate with, you’ll only need to do this until the cookie expires:

curl -c cookies.txt -d "vb_login_username=<username>&vb_login_password=<password>&do=login&cookieuser=1" https://secure.wowinterface.com/forums/login.php
Use the cookie file you made to send requests to the API:
  • GET AddOns you have access to:
  • GET AddOn details:
  • curl -b cookies.txt http://api.wowinterface.com/addons/details/<addon id>.json
  • POST Updates: (If you GET the endpoint it will list what can be changed via this endpoint)
  • curl -b cookies.txt -F "id=<addon id>" -F "version=<your addon version number>" -F "compatible=<patch numbers, comma delimited>" -F "updatefile=@/path/to/local/file.zip" http://api.wowinterface.com/addons/update
  • List of valid data you can POST:


BigWigs' packager project: https://github.com/BigWigsMods/packager. Info here.


HTTP:
Error Responce:
  • 403 - You must be authenticated to use this API. (Missing or invalid token or cookie)
  • 404 - No AddOns found. (You don't have any AddOns)
  • 404 - ID(s) are missing for AddOn details.
  • 405 - Missing required data fields for AddOn Update (See actual error message for a list of fields)
  • 403 - AddOn Disabled (An admin has disabled your AddOn)
  • 401 - Permission Denied (You are not the author or team member of this AddOn)
  • 415 - File type not supported (You have tried to upload a file other than a zip/rar)
  • 500 - File update failed (Contact an admin, something bad happened)

Normal Response:
  • 200 - (Returned when you successfully GET data from the API)
  • 202 - Update Accepted. (Returned when you POST an update to your AddOn)

Last edited by Cairenn : 10-01-18 at 11:04 PM.
  Reply With Quote
 

WoWInterface » Developer Discussions » Tutorials & Other Helpful Info. » WoWInterface AddOn update API

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off