<< Back to Programming Forum   Search

Posts 1 - 9 of 9   
Set Map Details API - No Auth Found: 2023-07-11 12:27:57


Mgreedy 
Level 35
Report
I've been trying to create a tool for speeding up map making by making some tooling in the form of an extension in inkscape.

I'm having some issues with authenticating with the set map details API however. I was hoping someone could sanity check that provided the api token and email were correct, this should be authenticating properly per the details available at:
https://www.warzone.com/wiki/Set_map_details_API

The map is definitely in development mode, not that it is reaching that point for it to be relevant.

Post Request:
{
    "email": "DEFINITELY_MY_EMAIL",
    "APIToken": "DEFINITELY_MY_TOKEN",
    "mapID": 103230,
    "commands": [
        {
            "command": "setTerritoryName",
            "id": 1632,
            "name": "A Test Name"
        }
    ]
}


Response:
Code: 200
Text: {
  "termsOfUse" : "Please use this API responsibly, as it can consume significant amounts of server resources if called excessively.",
  "error" : "No auth found"
}


Edited 7/11/2023 13:12:46
Set Map Details API - No Auth Found: 2023-07-11 13:11:40


FiveSmith 
Level 60
Report
Tested that payload:

- With wrong credentials I get {'error': 'Auth failed',...}
- With correct credentials I get {'error': 'Permission denied. Please verify the map ID is correct',...}

I failed to replicate getting the error, which you quoted.

Edited 7/11/2023 13:12:37
Set Map Details API - No Auth Found: 2023-07-11 13:13:59


Mgreedy 
Level 35
Report
Curious...

Thank you for confirming that for me. It is appreciated
Set Map Details API - No Auth Found: 2023-07-11 14:57:46


JK_3 
Level 63
Report
Make sure all capitals are in the right place (iirc Email should have a capital)

edit: i remembered wrong, wiki says is small letter

Edited 7/11/2023 14:59:03
Set Map Details API - No Auth Found: 2023-07-11 15:27:30

(deleted) 
Level 63
Report
Have you changed your password since when you last used your api token? Changing password means you get a new token, all others become invalid.

My only other thought is that the set map details api needs membership, but that's never been the case, unless it's a bug.

Can we have a code snippet of how your calling the api and making the post data?

Edited 7/11/2023 15:33:31
Set Map Details API - No Auth Found: 2023-07-11 15:33:24


Mgreedy 
Level 35
Report
The token is definitely correct but that was a good shout just in case.

After some more testing it appears to only happen when it's being run through inkscape. Sending via postman or a generic python script outside of inkscape and it's fine. I'll update on if I can find out what's causing the issue there
Set Map Details API - No Auth Found: 2023-07-20 18:30:30

(deleted) 
Level 63
Report
Any update?
Set Map Details API - No Auth Found: 2023-07-20 18:32:17


Mgreedy 
Level 35
Report
Not yet. I’ve still just had it commented out and been manually sending it off via postman while I develop the other parts I was working on. I do want to tackle it next week though so I’ll see if I have something then
Set Map Details API - No Auth Found: 2023-07-20 19:16:02


JK_3 
Level 63
Report
For some reason i still had code for an inkscape extension in my WZ software folder, maybe it will be of any use to you or someone else:
https://pastebin.com/HgqUuc7C
https://pastebin.com/qwQx26rG

Edited 7/20/2023 19:16:10
Posts 1 - 9 of 9