Thread Tools Display Modes
10/08/16, 03:36 PM   #1
Dolby
Every day I'm shuffling
 
Dolby's Avatar
Premium Member
WoWInterface Admin
Join Date: Feb 2004
Posts: 1,276
ESOUI AddOn update API

How to use the ESOUI API via Curl:

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.esoui.com/addons/list.json
GET AddOn details:
Code:
curl -H "x-api-token: <Your Token>" https://api.esoui.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=2.6" -F "updatefile=@/Users/dolby/Downloads/test2.zip" https://api.esoui.com/addons/update
List of valid data you can POST:
Just do a GET on https://api.esoui.com/addons/update and you’ll receive an error with a list of valid data points.

If you'd like to just test your script that interfaces with our API you can use the /updatetest endpoint instead: https://api.esoui.com/addons/updatetest. Nothing will actually save when you POST here so you can test that your script is working.


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 Dolby : 10/09/16 at 10:32 AM.
  Reply With Quote
10/25/16, 03:56 PM   #2
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,566
Is it possible to create a new addon via the api or do I have to upload it via the website the first time? Just wondering if I could automate that step for new addons.
  Reply With Quote
10/25/16, 04:34 PM   #3
Dolby
Every day I'm shuffling
 
Dolby's Avatar
Premium Member
WoWInterface Admin
Join Date: Feb 2004
Posts: 1,276
First time (New projects) you need to upload it via the website.
  Reply With Quote
12/28/16, 04:47 AM   #4
Taraezor
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 4
Thumbs up Mac OSX

Well I checked if we in OSX land have Curl. BSD Unix roots and all... a quick "man curl" in the Terminal app confirms we are good to go, maybe.

Got as far as testing using the "update test" suggestion as per the OP.

All good.

Example:

1) Generate your token as per the link above.
2) Fire up your Terminal app.
3) curl -H "x-api-token:tttttttttttttttttttttttttt" https://api.esoui.com/addons/list.json

That will give a table of all your ESO AddOns. The ID is the important bit. Most likely a three digit number. That string of "t"s is your token. It'll be heaps longer than that!

4) curl -H "x-api-token:tttttttttttttttttttttttttt" https://api.esoui.com/addons/details/nnn.json

where "nnn" is the ID of your AddOn. This step is not necessary. It just lists what is there if you can't be bothered getting that same data in a formatted Safari/Chrome page.

5) curl -H "x-api-token:tttttttttttttttttttttttttt" -F "id=nnn" -F "version=1.13" -F "compatible=2.6" -F "updatefile=@/Users/Chris/desktop/MyLovelyFile.zip" https://api.esoui.com/addons/updatetest

To test things out. Easy as that.

Next actual update I'll be using Curl although I must say that unlike other places which seem to be cursed <cough> with some kind of page loading or bandwidth problem, over here at ESOUI things are always nice and zippy so I don't mind using the web interface at all. But this system would be neat for bulk updates in one go.
  Reply With Quote
09/22/19, 03:53 AM   #5
Micke2nd
AddOn Author - Click to view addons
Join Date: Mar 2017
Posts: 43
is the curl upload the way how a addon is registered in "minion 3" and thus can be updated by it ?
  Reply With Quote
09/22/19, 06:15 AM   #6
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,903
afaik Minion 3 isn't using this and it is also only downloading stuff from the esoui database, and not uplaoding to it.
  Reply With Quote
09/22/19, 08:21 AM   #7
Dolby
Every day I'm shuffling
 
Dolby's Avatar
Premium Member
WoWInterface Admin
Join Date: Feb 2004
Posts: 1,276
Originally Posted by Micke2nd View Post
is the curl upload the way how a addon is registered in "minion 3" and thus can be updated by it ?
Sorry, Minion does not pull from the ESO Tools & Utilities category and doesn't work with exe's. It only works with Actual lua AddOns.
  Reply With Quote
09/22/19, 01:46 PM   #8
Micke2nd
AddOn Author - Click to view addons
Join Date: Mar 2017
Posts: 43
Thumbs up

Originally Posted by Baertram View Post
... and not uplaoding to it.
i meant to update the "customer" installation with minion. The upload i would have handled however its neccessary (e.g. with curl) , cause i like the minion tool

Originally Posted by Dolby View Post
... and doesn't work with exe's
oh my addon doesnt need the *.exe, i deliver it primarly as script. i like the transparent approach. But anyway, got it.

thank you both for the quick reply !
  Reply With Quote
11/19/19, 09:12 PM   #9
AlbinoPython
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 24
I know this thread is pretty old but just wanted to share that, with the info I got here, I created esoui-publish which is a small npmjs module that translates this curl command to a node request. It has a programmatic API and it can be used via command line. Publishing to esoui could be as simple as:

Code:
esoui-publish --id=2271 --updatefile=my-addon.zip
  Reply With Quote
06/05/20, 05:10 AM   #10
Keldor
 
Keldor's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2015
Posts: 101
Is it possible to update the changelog field when uploading a file through the API or do I always have to update the changelog lines by hand?

Edit: Sorry have not seen the available field list
  Reply With Quote
06/05/20, 08:32 AM   #11
Dolby
Every day I'm shuffling
 
Dolby's Avatar
Premium Member
WoWInterface Admin
Join Date: Feb 2004
Posts: 1,276
If you load the update endpoint it will echo out the availble fields you can post to

https://api.esoui.com/addons/update
  Reply With Quote
09/09/20, 08:25 AM   #12
bi0cable
Join Date: Jul 2020
Posts: 2
Question so whats wrong?

help me pls! i really don't understand, what am i doing wrong (sorry for my english =) )

so, i play on linux with steam (Proton 5.x.x.x)
Code:
ivan@legion AddOns]$ env
ESO_TOKEN=<so here's all right, like in my account>

[ivan@legion AddOns]$ pwd
/home/ivan/.steam/steam/steamapps/compatdata/306130/pfx/drive_c/users/steamuser/My Documents/Elder Scrolls Online/live/AddOns
[ivan@legion AddOns]$ ls -a
.                            HarvestMap                 LibCustomMenu    LibHarvensAddonSettings  LibSavedVars      VotansFishFillet
..                           ItemBrowser                LibCustomTitles  LibMainMenu-2.0          MapPins           VotansImprovedLocations
ActionDurationReminder       LibAddonMenu-2.0           LibDebugLogger   LibMapPing               PotionMaker       VotansImprovedProvisioner
AdvancedFilters              LibAlchemyStation          LibFeedback      LibMapPins-1.0           QuestMap          VotansMiniMap
arkadius-trade-tools-1.7.2   LibAsync                   LibFilters-3.0   LibMotifCategories       RaidNotifier
CustomCompassPins            LibChatMessage             LibGPS           LibNotification          SpentSkillPoints
HarvensImprovedSkillsWindow  libCommonInventoryFilters  LibGroupSocket   LibQuestData             VotansFisherman
[ivan@legion AddOns]$ curl -H "x-api-token: <ESO_TOKEN>" https://api.esoui.com/addons/list.json
{"ERROR":"No AddOns found."}[ivan@legion AddOns]$
so, what can be the problem here? i really don't understand. whenever i do API's - just load it in to ~/.bashrc and doing source ~/.bashrc - and that always work for me, but it doesn't work with ESO_TOKEN...
  Reply With Quote
09/09/20, 08:31 AM   #13
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,903
This API exists to upload/update YOUR created addons. Do you want to upload an addon you have build?
It's not downloading addons or updates. Please use "Minion" for this purpose.
  Reply With Quote
09/09/20, 02:10 PM   #14
bi0cable
Join Date: Jul 2020
Posts: 2
Originally Posted by Baertram View Post
This API exists to upload/update YOUR created addons. Do you want to upload an addon you have build?
It's not downloading addons or updates. Please use "Minion" for this purpose.
ou, thnx =) if minion would be on linux...
  Reply With Quote
09/09/20, 02:56 PM   #15
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,903
It does run on linux. Search the forum for "minion linux" and you'll find these threads:
https://www.esoui.com/forums/showthr...t=minion+linux
https://www.esoui.com/forums/showthr...t=minion+linux
  Reply With Quote
01/20/21, 07:35 AM   #16
Keldor
 
Keldor's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2015
Posts: 101
Hello!

I think I found a bug in the API. Via Jenkins I update my AddOns with the script posted below.

When I check the project page of the AddOn, no supported ESO version is shown. If I edit the AddOn there is also no check mark at the supported versions set.

The variable COMPATIBLE_ID currently has the value "6.2.5". If I don't give curl a compatible value, it doesn't set the default either.

Code:
#!/bin/bash

ESOUI_ENDPOINT="https://api.esoui.com/addons/update"
ESOUI_COMPATIBLE_LIST="https://api.esoui.com/addons/compatible.json"
ESOUI_API_TOKEN="xx4541"
ESOUI_ADDON_ID="12345"

COMPATIBLE_LIST=$(curl --fail -s -L -H "x-api-token: ${ESOUI_API_TOKEN}" "${ESOUI_COMPATIBLE_LIST}")
COMPATIBLE_ID=$(echo "${COMPATIBLE_LIST}" | jq '.[0].id')

curl --fail -s -L -H "x-api-token: ${ESOUI_API_TOKEN}" \
  -F "id=${ESOUI_ADDON_ID}" \
  -F "version=${VERSION_STR}" \
  -F "compatible=${COMPATIBLE_ID}" \
  -F "changelog=${CHANGELOG}" \
  -F "updatefile=@${WORKSPACE}/addon.zip" ${ESOUI_ENDPOINT}
Can anyone confirm the behavior?

Last edited by Keldor : 01/22/21 at 02:40 AM.
  Reply With Quote
01/20/21, 11:11 AM   #17
AlbinoPython
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 24
@Keldor, not sure what is going on with your command but I have a cross platform NPM utility that can publish addons from the command line that worked correctly for me last time I used it.

https://www.esoui.com/downloads/info...i-publish.html
https://www.npmjs.com/package/esoui-publish
  Reply With Quote
01/20/21, 01:13 PM   #18
Keldor
 
Keldor's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2015
Posts: 101
Thanks for yout feedback
I've found the bug in my script. The jq command returned the JSON string value with quotes, which means that I sent the value "6.2.5" instead of 6.2.5

The solution in my bash script was to change this line
Code:
COMPATIBLE_ID=$(echo "${COMPATIBLE_LIST}" | jq '.[0].id')
to
Code:
COMPATIBLE_ID=$(echo "${COMPATIBLE_LIST}" | jq --raw-output '.[0].id')

Last edited by Keldor : 01/21/21 at 03:34 AM.
  Reply With Quote
03/11/21, 12:03 AM   #19
xeio
AddOn Author - Click to view addons
Join Date: Jan 2020
Posts: 1
I got a bit too bored and created a GitHub action for this.

https://github.com/Xeio/esoui-deploy-action

It reads the Version and APIVersion from the add-on file in the repo and pushes them, and does the translation from the in-game APIVersion to the ESO UI version. It also pulls the notes in the GitHub release and sends them as the changelog (if present).

I still have to manually create the release and add the update note, though I suppose I could just automate creating the release separately when I commit... then again my commit messages make bad release notes so maybe not.


This is the workflow I'm using in my add-on repo, though it's pretty much identical to the example I put in the action readme above:

https://github.com/Xeio/ControllerTw...flows/main.yml
  Reply With Quote
05/28/21, 09:21 AM   #20
buldezir
AddOn Author - Click to view addons
Join Date: Oct 2018
Posts: 3
gitlab CI config to publish:

Code:
stages:
  - publish

variables:
  ESOUI_ADDON_ID: XXXX
  ESOUI_DIRNAME: AddonName (same as AddonName.txt)
  
  ESOUI_COMPATIBLE_IDS: 6.3.5,7.0
  ESOUI_VERSION: 1.0.$CI_PIPELINE_IID
  
  ESOUI_ENDPOINT: https://api.esoui.com/addons/update
  
publish:
  only:
    - master
  image: eamonwoortman/alpine-curl-zip
  stage: publish
  script:
    - 'mkdir /tmp/${ESOUI_DIRNAME} && cp -r ./* /tmp/${ESOUI_DIRNAME} && cd /tmp && zip -r ${ESOUI_DIRNAME}.zip ./${ESOUI_DIRNAME} -x ".*"'
    - 'curl --fail -s -L -H "x-api-token: ${ESOUI_TOKEN}" -F "id=${ESOUI_ADDON_ID}" -F "version=${ESOUI_VERSION}" -F "compatible=${ESOUI_COMPATIBLE_IDS}" -F "updatefile=@/tmp/${ESOUI_DIRNAME}.zip"  ${ESOUI_ENDPOINT}'
so for quick setup u need to set only ESOUI_ADDON_ID and ESOUI_DIRNAME for each addon.

Last edited by buldezir : 05/28/21 at 11:16 AM.
  Reply With Quote

ESOUI » Developer Discussions » Tutorials & Other Helpful Info » ESOUI 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