Jump to content

darkavenger

Members
  • Posts

    8
  • Joined

  • Last visited

Posts posted by darkavenger

  1. Thank you!!!

    what am I doing wrong here? I want to publish a test ticket. And i get 500 error

    result                                           
                                                    
       [success] =>                                 
       [error] => Array                             
           (                                        
               [code] => 500                        
               [message] => Internal Server Error   
               [details] => Internal Server Error   
           )                                        
                                                    
                                                    
        $data = [
            'title'  => 'test',
            'details' => 'sdfsd',
            // 'tenantId' => 6636,
            'accountId' => 112388,
            'locationId' => 127431,
            'contactId' => 97966,
            'softwareAssetId' => 0,
            'hardwareAssetId' => 0,
            'queueId' => 30526,
            'statusId' => 40482,
            'priorityId' => 33223,
            'typeId' => 8,
            'issueTypeId' => 0,
            'subIssueTypeId' => 0,
            'contractId' => 0,
            'assigneeId' => 0,
            'workTypeId' => 0,
            'sourceId' => 0,
            'slaId' => 0,
            'openDate' => "2022-01-23T12:31:13.003Z",
            'dueDate' => "2022-01-23T12:31:13.003Z",
            // 'secondaryAssignees' =>  json_encode([]),
            // 'ccs' => json_encode([
            //     'emailAddress' => '',
            //     'entityType' => 0,
            //     'id' => 0,
            // ]),
            // 'tempAttachments' =>  json_encode([
            //     'id' => 0,
            //     'name' => '',
            //     'alias' => ''
            // ]),
            // 'customFieldsData' =>  json_encode([
            //     'id' => 0,
            //     'customFieldId' => 0,
            //     'data' => '',
            //     'settingsId' => 0,
            // ]),
            'useDefaultContract' => true
        ];	    
    
    $data = json_encode($data);
    
        $headersTicket = [
            "Authorization: Bearer ".$accessToken,
            "accept: application/json",
            "Content-Type: application/json"
        ];
    
        $urlTicket = "https://api.psa.pulseway.com/v2/servicedesk/tickets";
        $ch = curl_init($urlTicket);
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headersTicket);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $data); 
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($ch, CURLOPT_HEADER, false);
        $res = curl_exec($ch);
        curl_close($ch);
        
        $res = json_decode($res, JSON_UNESCAPED_UNICODE);
    
        print_r($res);

     

×
×
  • Create New...