Asmor
First Post
I'm doing some work with the Compendium API, and finding that the documentation is not just... poor, but it's downright inaccurate in places. Working on doing filter select for monsters, and here's some things I've learned which I hope will help you.
1. The documentation says that non-specified filters must be "NULL". This is incorrect. They should be "null"-- lower case. This is one of the few places I've found where case matters.
2. When searching for monsters, the minimum and maximum xp cannot be "null". I've been using values of 0 and 1000000 respectively.
3. If you're using any sort of automation to pick up the interface, the API itself has the incorrect address listed. It lists "http://www.wizards.com/CompendiumSearch.asmx/[METHOD]" but it should be "http://www.wizards.com/dndinsider/compendium/CompendiumSearch.asmx/[METHOD]".
4. It says that several parameters are optional. For example, with a KeywordSearch, Tab is listed as being optional. This is technically true, but you still need to pass a Tab parameter-- just leave it empty.
5. Since releasing the API documentation, they've added a new required parameter called "NameOnly." It doesn't appear to do anything (I've tried setting it to both True and False, and noticed no difference). I recommend setting it to false. This parameter is required for KeywordSearch and KeywordSearchWithFilters
If anyone else has caught anything or just has any tips, please post 'em! This is my first time working with someone else's API and with SOAP, so I'd love to pick people's brains.
Oh, one thing that might not be obvious... If you're doing something in JavaScript, many recent browsers such as Firefox 3.5 have built in protections against cross-domain scripting which prevent a page on, say, asmor.com from loading data from, let's say, wizards.com. One way to get around that is to use a proxy on your webserver... I did some searching and found a PHP proxy specifically for these purposes which grabs the external data and returns it.
1. The documentation says that non-specified filters must be "NULL". This is incorrect. They should be "null"-- lower case. This is one of the few places I've found where case matters.
2. When searching for monsters, the minimum and maximum xp cannot be "null". I've been using values of 0 and 1000000 respectively.
3. If you're using any sort of automation to pick up the interface, the API itself has the incorrect address listed. It lists "http://www.wizards.com/CompendiumSearch.asmx/[METHOD]" but it should be "http://www.wizards.com/dndinsider/compendium/CompendiumSearch.asmx/[METHOD]".
4. It says that several parameters are optional. For example, with a KeywordSearch, Tab is listed as being optional. This is technically true, but you still need to pass a Tab parameter-- just leave it empty.
5. Since releasing the API documentation, they've added a new required parameter called "NameOnly." It doesn't appear to do anything (I've tried setting it to both True and False, and noticed no difference). I recommend setting it to false. This parameter is required for KeywordSearch and KeywordSearchWithFilters
If anyone else has caught anything or just has any tips, please post 'em! This is my first time working with someone else's API and with SOAP, so I'd love to pick people's brains.
Oh, one thing that might not be obvious... If you're doing something in JavaScript, many recent browsers such as Firefox 3.5 have built in protections against cross-domain scripting which prevent a page on, say, asmor.com from loading data from, let's say, wizards.com. One way to get around that is to use a proxy on your webserver... I did some searching and found a PHP proxy specifically for these purposes which grabs the external data and returns it.