Soap api - mc_tag_get_all

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
rienkwind
Posts: 8
Joined: 20 Jul 2017, 08:25

Soap api - mc_tag_get_all

Post by rienkwind »

I'm trying to get all tags from Mantis with the soap call mc_tag_get_all. Now I get back the array results with 11 tags but in Mantis there are 13.
It seems that I cant get the first two tags from the soap call. Is there a reason for? Does it only get the tags created by the logged in user?
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Soap api - mc_tag_get_all

Post by atrol »

I as not able to reproduce the issue.
Which MantisBT version do you use?
Please use Search before posting and read the Manual
rienkwind
Posts: 8
Joined: 20 Jul 2017, 08:25

Re: Soap api - mc_tag_get_all

Post by rienkwind »

I tested this on 2.14.0.
It sees the total results but thats not an array just a number.

Code: Select all

"results" => array:11 [▶]
  "total_results" => 13

I also use a mantis api bundle for Symfony maybe that causes the problem?
https://github.com/A5sys/MantisApiBundle
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Soap api - mc_tag_get_all

Post by atrol »

rienkwind wrote: 22 May 2018, 09:43 I also use a mantis api bundle for Symfony maybe that causes the problem?
I don't know and have no time to look at this 3rd party development.

When trying with two users and one tag created per user and sending this request

Code: Select all

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:man="http://futureware.biz/mantisconnect">
   <soapenv:Header/>
   <soapenv:Body>
      <man:mc_tag_get_all soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <username xsi:type="xsd:string">MyUser</username>
         <password xsi:type="xsd:string">MyPassword</password>
         <page_number xsi:type="xsd:integer">1</page_number>
         <per_page xsi:type="xsd:integer">100</per_page>
      </man:mc_tag_get_all>
   </soapenv:Body>
</soapenv:Envelope>
I get this response

Code: Select all

<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://futureware.biz/mantisconnect" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <SOAP-ENV:Body>
      <ns1:mc_tag_get_allResponse>
         <return xsi:type="ns1:TagDataSearchResult">
            <results SOAP-ENC:arrayType="ns1:TagData[2]" xsi:type="SOAP-ENC:Array">
               <item xsi:type="ns1:TagData">
                  <id xsi:type="xsd:integer">2</id>
                  <user_id xsi:type="ns1:AccountData">
                     <id xsi:type="xsd:integer">2</id>
                     <name xsi:type="xsd:string">y</name>
                     <real_name xsi:type="xsd:string">MyName</real_name>
                     <email xsi:type="xsd:string">MyEmail</email>
                  </user_id>
                  <name xsi:type="xsd:string">aaa</name>
                  <description xsi:type="xsd:string"/>
                  <date_created xsi:type="xsd:dateTime">2018-05-22T10:03:03+02:00</date_created>
                  <date_updated xsi:type="xsd:dateTime">2018-05-22T10:03:03+02:00</date_updated>
               </item>
               <item xsi:type="ns1:TagData">
                  <id xsi:type="xsd:integer">1</id>
                  <user_id xsi:type="ns1:AccountData">
                     <id xsi:type="xsd:integer">1</id>
                     <name xsi:type="xsd:string">administrator</name>
                  </user_id>
                  <name xsi:type="xsd:string">tag1</name>
                  <description xsi:type="xsd:string">beschr tag1</description>
                  <date_created xsi:type="xsd:dateTime">2018-05-22T09:46:25+02:00</date_created>
                  <date_updated xsi:type="xsd:dateTime">2018-05-22T09:46:25+02:00</date_updated>
               </item>
            </results>
            <total_results xsi:type="xsd:integer">2</total_results>
         </return>
      </ns1:mc_tag_get_allResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Which PHP version do you use?
Please use Search before posting and read the Manual
rienkwind
Posts: 8
Joined: 20 Jul 2017, 08:25

Re: Soap api - mc_tag_get_all

Post by rienkwind »

Ok it's solved. I had page_number -1 and per_page -1. I tried it like your example and it worked. Thanks
Post Reply