Get Projects

This comand is used to get a list of Projects from WHMCSPM2

Attributes

limitstart - Optional start at which result (default 0)
limitnum - Optional limit at how many results (default 25)
clientid - Optional search for a particular client's tickets
adminid - Optional search for a particular admin's projects
status - Optional search for a particular status
priority - Optional search for a particular priority
category - Optional search for a particular category

Example Command

$postfields["action"] = "whmcspm2getprojects";

Returned Variables

action
result - error / success
totalresults
startnumber
numreturned
projects - array of projects converted to xml, json or NVP
    - project
        - id
        - name
        - description
        - status
        - category
        - priority
        - filesok
        - tasksok
        - private
        - admin_email_ok
        - client_email_ok
        - client
        - assigned
        - startdate
        - enddate
        - creatortype (1=admin,2=client)
        - creator
        - budget
        - customfields

XML Example:

<whmcsapi>
    <action>whmcspm2getprojects</action>
    <result>success</results>
    <totalresults>2</totalresults>
    <startnumber>0</startnumber>
    <numreturned>2</numreturned>
    <projects>
        <project>
            <id>10</id>
            <name>Sample API Project</name>
            <description>A Description would go here!</description>
            <status>10</status>
            <category>3</category>
            <priority>2</priority>
            <filesok>1</filesok>
            <tasksok>1</tasksok>
            <private>0</private>
            <admin_email_ok>1</admin_email_ok>
            <client_email_ok>1</client_email_ok>
            <client>15</client>
            <assigned>1,10,13</assigned>
            <startdate>2011-09-29</startdate>
            <enddate>2011-11-13</enddate>
            <creatortype>1</creatortype>
            <creator>4</creator>
            <budget>250.00</budget>
            <customfields>
                <customfield>
                    <id>1</id>
                    <value>Test Field 1</value>
                </customfield>
                <customfield>
                    <id>3</id>
                    <value>Test Field 2</value>
                </customfield>
                <customfield>
                    <id>7</id>
                    <value>Test Field 3</value>
                </customfield>
            </customfields>
        </project>
        <project>
            <id>17</id>
            <name>Sample API Project Too</name>
            <description>A Description would go here!</description>
            <status>7</status>
            <category>1</category>
            <priority>3</priority>
            <filesok>1</filesok>
            <tasksok>1</tasksok>
            <private>0</private>
            <admin_email_ok>1</admin_email_ok>
            <client_email_ok>0</client_email_ok>
            <client>2</client>
            <assigned>1,10,13</assigned>
            <startdate>2011-10-29</startdate>
            <enddate>2011-12-13</enddate>
            <creatortype>0</creatortype>
            <creator>2</creator>
            <budget>1250.00</budget>
            <customfields>
                <customfield>
                    <id>13</id>
                    <value>Another Test Field</value>
                </customfield>
            </customfields>
        </project>
    </projects>
</whmcsapi>

JSON Example:

{
	"result":"success",
	"totalresults":2,
	"startnumber":0,
	"numreturned":2,
	"projects":{
		"project":[
			{
				"id":10,
				"name":"Sample API Project",
				"description":"A Description would go here!",
				"status":10,
				"category":3,
				"priority":2,
				"filesok":1,
				"tasksok":1,
				"private":0,
				"admin_email_ok":1,
				"client_email_ok":1,
				"client":15,
				"assigned":"1,10,13",
				"startdate":"2011-09-29",
				"enddate":"2011-11-13",
				"creatortype":1,
				"creator":4,
				"budget":"250.00",
				"customfields":{
					"customfield":[
						{
							"id":"1",
							"value":"Test Field 1"
						},
						{
							"id":"3",
							"value":"Test Field 2"
						},
						{
							"id":"7",
							"value":"Test Field 3"
						}
					]
				}
			},
			{
				"id":17,
				"name":"Sample API Project Too",
				"description":"A Description would go here!",
				"status":7,
				"category":1,
				"priority":3,
				"filesok":1,
				"tasksok":1,
				"private":0,
				"admin_email_ok":1,
				"client_email_ok":0,
				"client":2,
				"assigned":"1,10,13",
				"startdate":"2011-10-29",
				"enddate":"2011-12-13",
				"creatortype":0,
				"creator":2,
				"budget":"1250.00",
				"customfields":{
					"customfield":[
						{
							"id":"13",
							"value":"Another Test Field"
						}
					]
				}
			}
		]
	}
}

NVP Example:

Array
(
    [result] => success
    [totalresults] => 2
    [startnumber] => 0
    [numreturned] => 2
    [projects] => Array
        (
            [project] => Array
                (
                    [0] => Array
                        (
                            [id] => 10
                            [name] => Sample API Project
                            [description] => A Description would go here!
                            [status] => 10
                            [category] => 3
                            [priority] => 2
                            [filesok] => 1
                            [tasksok] => 1
                            [private] => 0
                            [admin_email_ok] => 1
                            [client_email_ok] => 1
                            [client] => 15
                            [assigned] => 1,10,13
                            [startdate] => 2011-09-29
                            [enddate] => 2011-11-13
                            [creatortype] => 1
                            [creator] => 4
                            [budget] => 250.00
                            [customfields] => Array
                                (
                                    [customfield] => Array
                                        (
                                            [0] => Array
                                                (
                                                    [id] => 1
                                                    [value] => Test Field 1
                                                )

                                            [1] => Array
                                                (
                                                    [id] => 3
                                                    [value] => Test Field 2
                                                )

                                            [2] => Array
                                                (
                                                    [id] => 7
                                                    [value] => Test Field 3
                                                )

                                        )

                                )

                        )

                    [1] => Array
                        (
                            [id] => 17
                            [name] => Sample API Project Too
                            [description] => A Description would go here!
                            [status] => 7
                            [category] => 1
                            [priority] => 3
                            [filesok] => 1
                            [tasksok] => 1
                            [private] => 0
                            [admin_email_ok] => 1
                            [client_email_ok] => 0
                            [client] => 2
                            [assigned] => 1,10,13
                            [startdate] => 2011-10-29
                            [enddate] => 2011-12-13
                            [creatortype] => 0
                            [creator] => 2
                            [budget] => 1250.00
                            [customfields] => Array
                                (
                                    [customfield] => Array
                                        (
                                            [0] => Array
                                                (
                                                    [id] => 13
                                                    [value] => Another Test Field
                                                )

                                        )

                                )

                        )

                )

        )

)

- client - assigned - startdate - enddate - creatortype (1=admin,2=client) - creator - budget - customfields

XML Example:

    whmcspm2_getprojects
    success
    2
    0
    2
    
        
            10
            Sample API Project
            A Description would go here!
            10
            3
            2
            1
            1
            0
            1
            1
            15
            1,10,13
            2011-09-29
            2011-11-13
            1
            4
            250.00
            
                
                    1
                    Test Field 1
                
                
                    3
                    Test Field 2
                
                
                    7
                    Test Field 3
                
            
        
        
            17
            Sample API Project Too
            A Description would go here!
            7
            1
            3
            1
            1
            0
            1
            0
            2
            1,10,13
            2011-10-29
            2011-12-13
            0
            2
            1250.00
            
                
                    13
                    Another Test Field
                
            
        
    

JSON Example:

{
	"results":"success",
	"totalresults":2,
	"startnumber":0,
	"numreturned":2,
	"projects":{
		"project":[
			{
				"id":10,
				"name":"Sample API Project",
				"description":"A Description would go here!",
				"status":10,
				"category":3,
				"priority":2,
				"filesok":1,
				"tasksok":1,
				"private":0,
				"admin_email_ok":1,
				"client_email_ok":1,
				"client":15,
				"assigned":"1,10,13",
				"startdate":"2011-09-29",
				"enddate":"2011-11-13",
				"creatortype":1,
				"creator":4,
				"budget":"250.00",
				"customfields":{
					"customfield":[
						{
							"id":"1",
							"value":"Test Field 1"
						},
						{
							"id":"3",
							"value":"Test Field 2"
						},
						{
							"id":"7",
							"value":"Test Field 3"
						}
					]
				}
			},
			{
				"id":17,
				"name":"Sample API Project Too",
				"description":"A Description would go here!",
				"status":7,
				"category":1,
				"priority":3,
				"filesok":1,
				"tasksok":1,
				"private":0,
				"admin_email_ok":1,
				"client_email_ok":0,
				"client":2,
				"assigned":"1,10,13",
				"startdate":"2011-10-29",
				"enddate":"2011-12-13",
				"creatortype":0,
				"creator":2,
				"budget":"1250.00",
				"customfields":{
					"customfield":[
						{
							"id":"13",
							"value":"Another Test Field"
						}
					]
				}
			}
		]
	}
}

NVP Example:

Array
(
    [results] => success
    [totalresults] => 2
    [startnumber] => 0
    [numreturned] => 2
    [projects] => Array
        (
            [project] => Array
                (
                    [0] => Array
                        (
                            [id] => 10
                            [name] => Sample API Project
                            [description] => A Description would go here!
                            [status] => 10
                            [category] => 3
                            [priority] => 2
                            [filesok] => 1
                            [tasksok] => 1
                            [private] => 0
                            [admin_email_ok] => 1
                            [client_email_ok] => 1
                            [client] => 15
                            [assigned] => 1,10,13
                            [startdate] => 2011-09-29
                            [enddate] => 2011-11-13
                            [creatortype] => 1
                            [creator] => 4
                            [budget] => 250.00
                            [customfields] => Array
                                (
                                    [customfield] => Array
                                        (
                                            [0] => Array
                                                (
                                                    [id] => 1
                                                    [value] => Test Field 1
                                                )

                                            [1] => Array
                                                (
                                                    [id] => 3
                                                    [value] => Test Field 2
                                                )

                                            [2] => Array
                                                (
                                                    [id] => 7
                                                    [value] => Test Field 3
                                                )

                                        )

                                )

                        )

                    [1] => Array
                        (
                            [id] => 17
                            [name] => Sample API Project Too
                            [description] => A Description would go here!
                            [status] => 7
                            [category] => 1
                            [priority] => 3
                            [filesok] => 1
                            [tasksok] => 1
                            [private] => 0
                            [admin_email_ok] => 1
                            [client_email_ok] => 0
                            [client] => 2
                            [assigned] => 1,10,13
                            [startdate] => 2011-10-29
                            [enddate] => 2011-12-13
                            [creatortype] => 0
                            [creator] => 2
                            [budget] => 1250.00
                            [customfields] => Array
                                (
                                    [customfield] => Array
                                        (
                                            [0] => Array
                                                (
                                                    [id] => 13
                                                    [value] => Another Test Field
                                                )

                                        )

                                )

                        )

                )

        )

)
Was this answer helpful? 0 Users Found This Useful (41 Votes)