Ok, updated patchset at https://gerrit.wikimedia.org/r/#/c/7832/

Thoughts? Worth adding more structure or is this good enough?


JSON output looks like this (config portion is now optional, leave it out to just get a list of campaigns):

{
	"uploadcampaign": {
		"campaigns": [
			{
				"name": "wlm-fake",
				"id": 1,
				"isenabled": 0,
				"config": {
					"autoCategories": [
						"AutoCat1",
						"AutoCat2"
					],
					"autoWikiText": "",
					"defaultAlt": "",
					"defaultCategories": [
						"ListCat1",
						"ListCat2"
					],
					"defaultDescription": "",
					"defaultLat": "",
					"defaultLon": "",
					"defaultOwnWorkLicence": "cc-by-sa-3.0",
					"headerLabelPage": "",
					"idField": "",
					"idFieldInitialValue": "",
					"idFieldLabel": "",
					"idFieldLabelPage": "",
					"idFieldMaxLength": "25",
					"licensesOwnWork": [
						"cc-by-sa-3.0",
						"cc-by-3.0",
						"cc-zero"
					],
					"ownWorkOption": "choice",
					"skipTutorial": "",
					"thanksLabelPage": "",
					"tutorialHelpdeskCoords": "27, 1319, 691, 1384",
					"tutorialTemplate": "Licensing_tutorial_$1.svg",
					"tutorialWidth": "720"
				}
			}
		]
	}
}
or xml:
<api>
  <uploadcampaign>
    <campaigns>
      <campaign>
        <name xml:space="preserve">wlm-fake</name>
        <id xml:space="preserve">1</id>
        <isenabled xml:space="preserve">0</isenabled>
        <config>
          <autoCategories>
            <category>AutoCat1</category>
            <category>AutoCat2</category>
          </autoCategories>
          <autoWikiText xml:space="preserve" />
          <defaultAlt xml:space="preserve" />
          <defaultCategories>
            <category>ListCat1</category>
            <category>ListCat2</category>
          </defaultCategories>
          <defaultDescription xml:space="preserve" />
          <defaultLat xml:space="preserve" />
          <defaultLon xml:space="preserve" />
          <defaultOwnWorkLicence xml:space="preserve">cc-by-sa-3.0</defaultOwnWorkLicence>
          <headerLabelPage xml:space="preserve" />
          <idField xml:space="preserve" />
          <idFieldInitialValue xml:space="preserve" />
          <idFieldLabel xml:space="preserve" />
          <idFieldLabelPage xml:space="preserve" />
          <idFieldMaxLength xml:space="preserve">25</idFieldMaxLength>
          <licensesOwnWork>
            <license>cc-by-sa-3.0</license>
            <license>cc-by-3.0</license>
            <license>cc-zero</license>
          </licensesOwnWork>
          <ownWorkOption xml:space="preserve">choice</ownWorkOption>
          <skipTutorial xml:space="preserve" />
          <thanksLabelPage xml:space="preserve" />
          <tutorialHelpdeskCoords xml:space="preserve">27, 1319, 691, 1384</tutorialHelpdeskCoords>
          <tutorialTemplate xml:space="preserve">Licensing_tutorial_$1.svg</tutorialTemplate>
          <tutorialWidth xml:space="preserve">720</tutorialWidth>
        </config>
      </campaign>
    </campaigns>
  </uploadcampaign>
</api>

(The xml:space="preserve"s all come in from the framework, I didn't add em!)

-- brion