1. Home
  2. Docs
  3. WP Project Manager
  4. Developer Docs
  5. REST API

REST API

Introduction

WP Project Manager API is made following the REST method and is dependent on WP-API plugin available on github. So you need to have this plugin installed on your system and wp pro

Authentication

To set up the authentication process is really simple and will not

Authentication

You authenticate to the project manager API by providing one of your API keys in the request. You can manage your API keys from your wp-admin profile. Your API keys carry many privileges, so be sure to keep them secret!

A simple example for getting all projects with authentication

Example

global $wp_version;

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db6', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	),
	'method'     => 'GET',
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( ‘/’ ),
);

$response = wp_remote_get( 'http://example.com/cpm-json/projects/', $params );

Projects

Get all project

- Request URI: http://example.com/cpm-json/projects/?count=-1
- Method: GET

Example

global $wp_version;

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db6', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	)
	'method'     => "GET",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_get( 'http://example.com/cpm-json/projects/', $params );

 

Get single project

- Request URI: http://example.com/cpm-json/projects/{project_id}
- Method: GET

Example

global $wp_version;

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db6', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	)
	'method'     => "GET",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_get( 'http://example.com/cpm-json/projects/101', $params );

 

Create project

Arguments (array)

project_name (string, required)
project_description string
project_cat init
role array( '{user_id}' => 'manager', '{user_id}' => 'co_worker', '{user_id}' => 'client' )

- Request URI: http://example.com/cpm-json/projects/
- Method: POST

Example

global $wp_version;
$args = array(
	'project_name'        => 'test',
	'project_description' => 'Details',
	'project_cat'         => 2,
	'role'                => array( '1' => 'manager', '2' => 'co_worker', '3' => 'client' )
);

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	),
	'body'       => $args,
	'method'     => "POST",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);
$response = wp_remote_post( 'http://localhost/cpm/cpm-json/projects/', $params );

 

Edit project

Arguments (array)

- project_name string (required)
- project_description string
- project_cat init
- role array( '{user_id}' => 'manager', '{user_id}' => 'co_worker', '{user_id}' => 'client' )
- Request URI: http://example.com/cpm-json/projects/{project_id}
- Method: POST

Example

global $wp_version;

$args = array(
	'project_name'        => 'test',
	'project_description' => 'Details',
	'project_cat'         => 2,
	'role'                => array( '1' => 'manager', '2' => 'co_worker', '3' => 'client' )
);

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	),
	'body'       => $args,
	'method'     => "POST",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_post( 'http://localhost/cpm/cpm-json/projects/101', $params );

 

Delete project

- Request URI: http://example.com/cpm-json/projects/project_id/?force=1 or 0
- Method: DELETE

Example

global $wp_version;

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	),
	'method'     => "DELETE",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_post( 'http://localhost/cpm/cpm-json/projects/101?force=1', $params );

Messages

Get all message

- Request URI: http://example.com/cpm-json/projects/{project_id}/messages/
- Method: GET

Example

global $wp_version;

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db6', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	)
	'method'     => "GET",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_get( 'http://example.com/cpm-json/projects/101/messages/', $params );

 

Get single message

- Request URI: http://example.com/cpm-json/projects/{project_id}/messages/{message_id}
- Method: GET

Example

global $wp_version;

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db6', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	)
	'method'     => "GET",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_get( 'http://example.com/cpm-json/projects/101/messages/200', $params );

 

Create message

Arguments (array)

- message_title (string, required)
- message_detail (string)
- message_privacy (string)
- milestone (integer )
- Request URI: http://example.com/cpm-json/projects/{project_id}/messages
- Method: POST

Example

global $wp_version;
$args = array(
	'message_title'   => 'test',
	'message_detail'  => 'Details',
	'message_privacy' => 'yes' or 'no',
	'milestone'       => 300
);

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	),
	'body'       => $args,
	'method'     => "POST",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);
$response = wp_remote_post( 'http://example.com/cpm-json/projects/101/messages', $params );

 

Edit message

Arguments (array)

- message_title (string, required)
- message_detail (string)
- message_privacy (string)
- milestone (integer )

 

- Request URI: http://example.com/cpm-json/projects/{project_id}/messages/{message_id}
- Method: POST

Example

global $wp_version;

$args = array(
	'message_title'   => 'test',
	'message_detail'  => 'Details',
	'message_privacy' => 'yes' or 'no',
	'milestone'       => 300
);

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	),
	'body'       => $args,
	'method'     => "POST",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_post( 'http://example.com/cpm-json/projects/101/messages/200', $params );

 

Delete message

- Request URI: http://example.com/cpm-json/projects/project_id/messages/{message_id}/?force=1 or 0
- Method: DELETE

Example

global $wp_version;

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	),
	'method'     => "DELETE",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_post( 'http://example.com/cpm-json/projects/101/messages/200/?force=1', $params );

To-do Lists

Get all to-do list

- Request URI: http://example.com/cpm-json/projects/{project_id}/lists
- Method: GET

Example

global $wp_version;

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db6', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	)
	'method'     => "GET",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_get( 'http://example.com/cpm-json/projects/101/lists/', $params );

 

Get single to-do list

- Request URI: http://example.com/cpm-json/projects/{project_id}/lists/{list_id}
- Method: GET

Example

global $wp_version;

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db6', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	)
	'method'     => "GET",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_get( 'http://example.com/cpm-json/projects/101/lists/400', $params );

 

Create to-do list

Arguments (array)

- tasklist_name (string, required)
- tasklist_detail (string)
- tasklist_privacy (string)
- tasklist_milestone (integer)

 

- Request URI: http://example.com/cpm-json/projects/{project_id}/lists
- Method: POST

Example

global $wp_version;

$args = array(
        'tasklist_name'      => 'test',
	'tasklist_detail'    => 'Details',
	'tasklist_privacy'   => 'yes' or 'no',
	'tasklist_milestone' => 300
);

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	),
	'body'       => $args,
	'method'     => "POST",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_post( 'http://example.com/cpm-json/projects/101/lists', $params );

 

Edit to-do list

Arguments (array)

- tasklist_name (string, required)
- tasklist_detail (string)
- tasklist_privacy (string)
- tasklist_milestone (integer)

 

- Request URI: http://example.com/cpm-json/projects/{project_id}/lists/{list_id}
- Method: POST

Example

global $wp_version;

$args = array(
        'tasklist_name'      => 'test',
	'tasklist_detail'    => 'Details',
	'tasklist_privacy'   => 'yes' or 'no',
	'tasklist_milestone' => 300
);

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	),
	'body'       => $args,
	'method'     => "POST",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_post( 'http://example.com/cpm-json/projects/101/lists/400', $params );

 

Delete to-do list

- Request URI: http://example.com/cpm-json/projects/{project_id}/lists/{list_id}/?force=1 or 0
- Method: DELETE

Example

global $wp_version;

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	),
	'method'     => "DELETE",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_post( 'http://example.com/cpm-json/projects/101/lists/400/?force=1', $params );

To-Do

Get all to-do

- Request URI: http://example.com/cpm-json/projects/{project_id}/lists/{list_id}/tasks
- Method: GET

Example

global $wp_version;

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db6', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	)
	'method'     => "GET",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_get( 'http://example.com/cpm-json/projects/101/lists/400/tasks', $params );

 

Get single to-do

- Request URI: http://example.com/cpm-json/projects/{project_id]/lists/{list_id}/tasks/{task_id}
- Method: GET

Example

global $wp_version;

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db6', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	)
	'method'     => "GET",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_get( 'http://example.com/cpm-json/projects/101/lists/400/tasks/500', $params );

 

Create to-do

Arguments (array)

- task_text (string, required)
- task_privacy (string)
- task_assign (array)
- task_due (date format)
- task_start (date format)

 

- Request URI: http://example.com/cpm-json/projects/{project_id}/lists/{list_id}/tasks
- Method: POST

Example

global $wp_version;

$args = array(
        'task_text'    => 'test',
	'task_privacy' => 'yes' or 'no',
	'task_assign'  => array( '{user_id}', '{user_id}', '{user_id}' ),
	'task_due'     => '2015-05-17 08:25:09',
	'task_start'   => '2015-06-17 08:25:09'
);

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	),
	'body'       => $args,
	'method'     => "POST",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_post( 'http://example.com/cpm-json/projects/101/lists/400/tasks', $params );

 

Edit to-do

Arguments (array)

- task_text (string, required)
- task_privacy (string)
- task_assign (array)
- task_due (date format)
- task_start (date format)

 

- Request URI: http://example.com/cpm-json/projects/{project_id}/lists/{list_id}/tasks/{task_id}
- Method: POST

Example

global $wp_version;

$args = array(
        'task_text'    => 'test',
	'task_privacy' => 'yes' or 'no',
	'task_assign'  => array( '{user_id}', '{user_id}', '{user_id}' ),
	'task_due'     => '2015-05-17 08:25:09',
	'task_start'   => '2015-06-17 08:25:09'
);

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	),
	'body'       => $args,
	'method'     => "POST",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_post( 'http://example.com/cpm-json/projects/101/lists/400/tasks/500', $params );

 

Delete to-do

- Request URI: http://example.com/cpm-json/projects/{project_id}/lists/{list_id}/tasks/{task_id}/?force=1 or 0
- Method: DELETE

Example

global $wp_version;

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	),
	'method'     => "DELETE",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_post( 'http://example.com/cpm-json/projects/101/lists/400/tasks/500/?force=1', $params );

Milestones

Get all milestone

- Request URI: http://example.com/projects/{project_id}/milestones
- Method: GET

Example

global $wp_version;

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db6', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	)
	'method'     => "GET",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_get( 'http://example.com/projects/101/milestones', $params );

 

Get single milestone

- Request URI: http://example.com/cpm-json/projects/{project_id}/milestones/{milestone_id}
- Method: GET

Example

global $wp_version;

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db6', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	)
	'method'     => "GET",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_get( 'http://example.com/cpm-json/projects/101/milestones/600', $params );

 

Create milestone

Arguments (array)

- milestone_name (string, required)
- milestone_due (date format)
- milestone_detail (string)
- milestone_privacy (string)

 

- Request URI: http://example.com/cpm-json/projects/{project_id}/milestones
- Method: POST

Example

global $wp_version;

$args = array(
        'milestone_name'    => 'test',
	'milestone_due'     => '2015-05-17 08:25:09',
	'milestone_detail'  => 'details',
	'milestone_privacy' => 'yes' or 'no',
);

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	),
	'body'       => $args,
	'method'     => "POST",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_post( 'http://example.com/cpm-json/projects/101/milestones', $params );

 

Edit milestone

Arguments (array)

- milestone_name (string, required)
- milestone_due (date format)
- milestone_detail (string)
- milestone_privacy (string)

 

- Request URI: http://example.com/cpm-json/projects/{project_id}/milestones/{milestone_id}
- Method: POST

Example

global $wp_version;

$args = array(
        'milestone_name'    => 'test',
	'milestone_due'     => '2015-05-17 08:25:09',
	'milestone_detail'  => 'details',
	'milestone_privacy' => 'yes' or 'no',
);

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	),
	'body'       => $args,
	'method'     => "POST",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_post( 'http://example.com/cpm-json/projects/101/milestones/600', $params );

 

Delete milestone

- Request URI: http://example.com/cpm-json/projects/{project_id}/milestones/{milestone_id}/?force=1 or 0
- Method: DELETE

Example

global $wp_version;

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	),
	'method'     => "DELETE",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_post( 'http://example.com/cpm-json/projects/101/milestones/600/?force=1', $params );

Comments

Get all comment for message

- Request URI: http://example.com/projects/{project_id}/messages/{message_id}/comments
- Method: GET

Example

global $wp_version;

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db6', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	)
	'method'     => "GET",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_get( 'http://example.com/projects/101/messages/200/comments', $params );

 

Get single comment for message

- Request URI: http://example.com/cpm-json/projects/{project_id}/messages/{message_id}/comments/{comment_id}
- Method: GET

Example

global $wp_version;

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db6', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	)
	'method'     => "GET",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_get( 'http://example.com/cpm-json/projects/101/messages/200/comments/700', $params );

 

Create comment for message

Arguments (array)

- comment_content (string)

 

- Request URI: http://example.com/cpm-json/projects/{project_id}/messages/{message_id}/comments
- Method: POST

Example

global $wp_version;

$args = array(
        'comment_content' => 'test'
);

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	),
	'body'       => $args,
	'method'     => "POST",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_post( 'http://example.com/cpm-json/projects/101/messages/200/comments', $params );

 

Edit comment for message

Arguments (array)

- comment_content (string)

 

- Request URI: http://example.com/cpm-json/projects/{project_id}/messages/{message_id}/comments/{comment_id}
- Method: POST

Example

global $wp_version;

$args = array(
        'comment_content' => 'test'
);

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	),
	'body'       => $args,
	'method'     => "POST",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_post( 'http://example.com/cpm-json/projects/101/messages/200/comments/700', $params );

 

Delete comment for message

- Request URI: http://example.com/cpm-json/projects/{project_id}/messages/{message_id}/comments/{comment_id}
- Method: DELETE

Example

global $wp_version;

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	),
	'method'     => "DELETE",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_post( 'http://example.com/cpm-json/projects/101/messages/200/comments/700', $params );

 

Get all comment for to-do list

- Request URI: http://example.com/projects/{project_id}/lists/{list_id}/comments
- Method: GET

Example

global $wp_version;

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db6', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	)
	'method'     => "GET",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_get( 'http://example.com/projects/101/lists/400/comments', $params );

 

Get single comment for to-do list

- Request URI: http://example.com/cpm-json/projects/{project_id}/lists/{list_id}/comments/{comment_id}
- Method: GET

Example

global $wp_version;

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db6', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	)
	'method'     => "GET",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_get( 'http://example.com/cpm-json/projects/101/lists/400/comments/700', $params );

 

Create comment for to-do list

Arguments (array)

- comment_content (string)

 

- Request URI: http://example.com/cpm-json/projects/{project_id}/lists/{list_id}/comments
- Method: POST

Example

global $wp_version;

$args = array(
        'comment_content' => 'test'
);

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	),
	'body'       => $args,
	'method'     => "POST",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_post( 'http://example.com/cpm-json/projects/101/lists/400/comments', $params );

 

Edit comment for to-do list

Arguments (array)

- comment_content (string)

 

- Request URI: http://example.com/cpm-json/projects/{project_id}/lists/{list_id}/comments/{comment_id}
- Method: POST

Example

global $wp_version;

$args = array(
        'comment_content' => 'test'
);

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	),
	'body'       => $args,
	'method'     => "POST",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_post( 'http://example.com/cpm-json/projects/101/lists/400/comments/700', $params );

 

Delete comment for to-do list

- Request URI: http://example.com/cpm-json/projects/{project_id}/lists/{list_id}/comments/{comment_id}
- Method: DELETE

Example

global $wp_version;

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	),
	'method'     => "DELETE",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_post( 'http://example.com/cpm-json/projects/101/lists/400/comments/700', $params );

 

Get all comment for to-do

- Request URI: http://example.com/projects/{project_id}/task/{task_id}/comments
- Method: GET

Example

global $wp_version;

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db6', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	)
	'method'     => "GET",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_get( 'http://example.com/projects/101/task/500/comments', $params );

 

Get single comment for to-do

- Request URI: http://example.com/cpm-json/projects/{project_id}/task/{task_id}/comments/{comment_id}
- Method: GET

Example

global $wp_version;

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db6', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	)
	'method'     => "GET",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_get( 'http://example.com/cpm-json/projects/101/task/500/comments/700', $params );

 

Create comment for to-do

Arguments (array)

- comment_content (string)

 

- Request URI: http://example.com/cpm-json/projects/{project_id}/task/{task_id}/comments
- Method: POST

Example

global $wp_version;

$args = array(
        'comment_content' => 'test'
);

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	),
	'body'       => $args,
	'method'     => "POST",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_post( 'http://example.com/cpm-json/projects/101/task/500/comments', $params );

 

Edit comment for to-do

Arguments (array)

- comment_content (string)

 

- Request URI: http://example.com/cpm-json/projects/{project_id}/task/{task_id}/comments/{comment_id}
- Method: POST

Example

global $wp_version;

$args = array(
        'comment_content' => 'test'
);

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	),
	'body'       => $args,
	'method'     => "POST",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_post( 'http://example.com/cpm-json/projects/101/task/500/comments/700', $params );

 

Delete comment for to-do

- Request URI: http://example.com/cpm-json/projects/{project_id}/task/{task_id}/comments/{comment_id}
- Method: DELETE

Example

global $wp_version;

$params = array(
	'headers' => array(
		'cpmkey'    => 'cpmk_0a5ae0969c526c53cddac57bb6365db', //user key
		'cpmsecret' => 'cpms_9dfb3d24ed8a9609f6f4eceb66511c8f' //user secret
	),
	'method'     => "DELETE",
	'sslverify'  => false,
	'timeout'    => 30,
	'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
);

$response = wp_remote_post( 'http://example.com/cpm-json/projects/101/task/500/comments/700', $params );

Was this article helpful to you?

How can we help?