Skip to content

Invalid request for subnet creation using Php Api clients  #33

Description

@mavrickultra

Hi,
I have a problem when i try to create a subnet after calling /api/my_app/sections/{id}/subnets/.
When i create the subnet alone without doing a get request to /api/my_app/sections/{id}/subnets/, it creates the subnet normally.
the code that is causing me a problem is this :
$this->execute('GET','sections',array("id"=>1,array('id2'=>'subnets',
//Ajout des filtres.
'filter_by'=>'description',
'filter_value'=>'subnet Infor'
),
$this->Token);
$this->execute('POST','subnets',array(),array("subnet"=>"172.13.0.32","sectionId"=>1,"mask"=>29,"masterSubnetId"=>$subnetId),
$this->Token);
my problem is when i delete the the call to return all subnets in section, it work prefectrly otherwise it gives this error :

array:4 [▼
  "code" => 400
  "success" => false
  "message" => """
    Invalid request key id2***stdClass Object


    (


        [app_id] => Wifup


        [controller] => sections


        [id] => 1


        [id2] => subnets


        [filter_by] => description


        [filter_value] => subnet Infor


        [subnet] => 172.13.0.32


        [sectionId] => 1


        [mask] => 29


        [masterSubnetId] => 31


    )


    """
  "time" => 0.023
]
I want to know why i get this error if i use the two calls and what im missing, because as i see phpipam remember the parameter sent in the first call so that is why i get the error.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions