src/Message.php
public function insert(array $data)
    {
        $project_id = empty($data['project_id']) ? 0: (int) $data['project_id'];
        if ($project_id <= 0) {
            throw new \TeamWorkPm\Exception('Required field project_id');
        }
        if (!empty($data['files'])) {
            $file = \TeamWorkPm\Factory::build('file');
            $data['pending_file_attachments'] = $file->upload($data['files']);
            unset($data['files']);
        }
        return $this->rest->post("projects/$project_id/$this->action", $data);
    }
public function insert(array $data)
    {
        $project_id = empty($data['project_id']) ? 0: (int) $data['project_id'];
        if ($project_id <= 0) {
            throw new \TeamWorkPm\Exception('Required field project_id');
        }
        if (!empty($data['files'])) {
            $file = \TeamWorkPm\Factory::build('file');
            $data['pending_file_attachments'] = $file->upload($data['files']);
            unset($data['files']);
        }
        return $this->rest->post("projects/$project_id/$this->action", $data);
    }
public function insert ( array $ data ) { $ project_id = empty ( $ data [ 'project_id' ] ) ? 0 : ( int ) $ data [ 'project_id' ] ; if ( $ project_id <= 0 ) { throw new \ TeamWorkPm \ Exception ( 'Required field project_id' ) ; } if ( ! empty ( $ data [ 'files' ] ) ) { $ file = \ TeamWorkPm \ Factory :: build ( 'file' ) ; $ data [ 'pending_file_attachments' ] = $ file -> upload ( $ data [ 'files' ] ) ; unset ( $ data [ 'files' ] ) ; } return $ this -> rest -> post ( "projects/$project_id/$this->action" , $ data ) ; }
Create a message

POST /projects/#{project_id}/posts.xml

This will create a new message.
Also, you have the option of sending a notification to a list of people you specify.

@param array $data

@return int
@throws \TeamWorkPm\Exception
Create a message