Skip to content

create resource returns empty item id #81

@Ash-raf10

Description

@Ash-raf10

Whenever I create a new resource/entity I am supposed to get the created resource/entity id in the response but instead I am getting empty({}) response. The response is showing 200 status. Also I checked, the record is indeed getting created in the autotask.

This is the code I am using

public function createContact()
{
    $contact = new ContactEntity(
        [
            'id' => 0, // Autotask requires that new entities have an ID of 0
            'companyID' => 0,
            'firstName' => 'New',
            'lastName' => 'User',
            'isActive' => 1,
        ]
    );
    try {
        $response = $this->autoTaskClient->contacts()->create($contact);
        return response()->json($response);
    } catch (\Exception $exception) {
        return $exception->getMessage();
    }
}

It returned {} only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs infoNeeds more information.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions