<< Back to GForge REST API

Entity: User

GET

getActivityLog

Parameters (1)

Name Type Description
request \RequestParameters

Related Entities (1)

Return: \gforge\core\models\api\ActivityLogBasic[]

Name Type Description
id int Unique database field for the activity log
date \datetimetz Date and time of the log
section string Type of the associated object
refId int Id of object associated with this activity log
description string Description of the action that was logged
activityType string Type of activity
url string Url associated with the log
userApiUrl string Api url of user
projectApiUrl string Api url of project
userId int Unique identifier for the user
project \models\Project
projectId int
extendedData object Additional information about the target of this activity record (e.g., tracker item, document, wiki page, user, etc.). Fields and format depend on the target object.

Example 1

Get activity log for gforgeadmin user, with defaults set
     GET http://next.centos6-restapi.example.com/api/user/gforgeadmin/activitylog
{
 "paging":{
    "page_size":20,
    "page_num":1,
    "sort_field":"id",
    "sort_dir":"asc"
 },
 "items":[
    {
       "id":915,
       "date":"2015-02-05 16:23:13 -0300",
       "section":"trackeritem",
       "refId":95,
       "description":null,
       "activityType":"create",
       "url":"\/gf\/project\/test_phash\/tracker\/?action=TrackerItemEdit&tracker_item_id=95",
       "userApiUrl":"\/api\/user\/101",
       "projectApiUrl":"\/api\/project\/",
       "userId":101,
       "projectId":null,
       "project":null,
       "extendedData":{
          "tracker_item_id":95,
          "tracker_id":204,
          "status_id":1,
          "priority":3,
          "submitted_by":101,
          "open_date":"2015-02-05 19:23:12",
          "close_date":null,
          "summary":"Testing 123",
          "details":"\nTesting 123\n",
          "last_modified_date":"2015-02-05 19:23:12",
          "last_modified_by":0,
          "sort_order":0,
          "parent_id":0,
          "has_subitems":false,
          "subitems_count":0,
          "waiting_for":0,
          "sprint_id":null,
          "tracker_name":"Bugs"
       }
    },
    {
       "id":916,
       "date":"2015-02-05 13:26:16 -0300",
       "section":"trackeritem",
       "refId":96,
       "description":null,
       "activityType":"create",
       "url":"\/gf\/project\/test_phash\/tracker\/?action=TrackerItemEdit&tracker_item_id=96",
       "userApiUrl":"\/api\/user\/101",
       "projectApiUrl":"\/api\/project\/",
       "userId":101,
       "projectId":null,
       "project":null,
       "extendedData":{
          "tracker_item_id":96,
          "tracker_id":204,
          "status_id":1,
          "priority":3,
          "submitted_by":101,
          "open_date":"2015-02-05 16:26:16",
          "close_date":null,
          "summary":"Testing tracker item",
          "details":"\nTesting tracker item\n",
          "last_modified_date":"2015-02-05 16:26:16",
          "last_modified_by":0,
          "sort_order":0,
          "parent_id":0,
          "has_subitems":false,
          "subitems_count":0,
          "waiting_for":0,
          "sprint_id":null,
          "tracker_name":"Bugs"
       }
    }
 ],
 "links":[

 ]
}

Example 2

Get activity log with projects, with all parameters set and associated related data
     GET http://next.centos6-restapi.example.com/api/user/gforgeadmin/activitylog?rel=project&startDate=2015-01-01&endDate=2015-02-01&max=10

 {
 "paging":{
    "page_size":20,
    "page_num":1,
    "sort_field":"id",
    "sort_dir":"asc"
 },
 "items":[
    {
       "id":914,
       "date":"2015-01-27 13:07:04 -0300",
       "section":"wiki",
       "refId":47,
       "description":null,
       "activityType":"update",
       "url":"\/gf\/project\/testing3\/wiki\/?pagename=NewPage",
       "userApiUrl":"\/api\/user\/101",
       "projectApiUrl":"\/api\/project\/",
       "userId":101,
       "projectId":null,
       "project":{
          "id":47,
          "name":"test_export",
          "unixName":"testing3",
          "description":"test_export",
          "homepageUrl":"\/gf\/project\/testing3\/",
          "createDate":"2013-08-02 05:33:45 -0300",
          "isPublic":"Y",
          "status":1,
          "isTemplate":"N",
          "templateProjectId":0
       },
       "extendedData":{
          "wiki_page_id":213,
          "section":"project",
          "ref_id":47,
          "pagename":"NewPage",
          "flags":0,
          "latest_version":{
          },
          "page_views":0
       }
    },
    {
       "id":913,
       "date":"2015-01-27 13:06:53 -0300",
       "section":"wiki",
       "refId":47,
       "description":null,
       "activityType":"create",
       "url":"\/gf\/project\/testing3\/wiki\/?pagename=NewPage",
       "userApiUrl":"\/api\/user\/101",
       "projectApiUrl":"\/api\/project\/",
       "userId":101,
       "projectId":null,
       "project":{
          "id":47,
          "name":"test_export",
          "unixName":"testing3",
          "description":"test_export",
          "homepageUrl":"\/gf\/project\/testing3\/",
          "createDate":"2013-08-02 05:33:45 -0300",
          "isPublic":"Y",
          "status":1,
          "isTemplate":"N",
          "templateProjectId":0
       },
       "extendedData":{
          "wiki_page_id":213,
          "section":"project",
          "ref_id":47,
          "pagename":"NewPage",
          "flags":0,
          "latest_version":null,
          "page_views":null
       }
    },
    {
       "id":912,
       "date":"2015-01-27 13:06:48 -0300",
       "section":"wiki",
       "refId":47,
       "description":null,
       "activityType":"update",
       "url":"\/gf\/project\/testing3\/wiki\/?pagename=FrontPage",
       "userApiUrl":"\/api\/user\/101",
       "projectApiUrl":"\/api\/project\/",
       "userId":101,
       "projectId":null,
       "project":{
          "id":47,
          "name":"test_export",
          "unixName":"testing3",
          "description":"test_export",
          "homepageUrl":"\/gf\/project\/testing3\/",
          "createDate":"2013-08-02 05:33:45 -0300",
          "isPublic":"Y",
          "status":1,
          "isTemplate":"N",
          "templateProjectId":0
       },
       "extendedData":{
          "wiki_page_id":171,
          "section":"project",
          "ref_id":47,
          "pagename":"FrontPage",
          "flags":0,
          "latest_version":{
          },
          "page_views":2
       }
    },
    {
       "id":911,
       "date":"2015-01-22 17:45:54 -0300",
       "section":"trackeritem",
       "refId":94,
       "description":null,
       "activityType":"create",
       "url":"\/gf\/project\/svn_test1\/tracker\/?action=TrackerItemEdit&tracker_item_id=94",
       "userApiUrl":"\/api\/user\/101",
       "projectApiUrl":"\/api\/project\/",
       "userId":101,
       "projectId":null,
       "project":{
          "id":49,
          "name":"svn_test1",
          "unixName":"svn_test1",
          "description":"testing",
          "homepageUrl":"\/gf\/project\/svn_test1\/",
          "createDate":"2013-10-17 13:36:17 -0300",
          "isPublic":"N",
          "status":1,
          "isTemplate":"N",
          "templateProjectId":41
       },
       "extendedData":{
          "tracker_item_id":94,
          "tracker_id":181,
          "status_id":1,
          "priority":3,
          "submitted_by":101,
          "open_date":"1969-12-31 23:59:59",
          "close_date":null,
          "summary":"Testing 123",
          "details":"",
          "last_modified_date":"2015-01-22 20:45:54",
          "last_modified_by":0,
          "sort_order":0,
          "parent_id":0,
          "has_subitems":false,
          "subitems_count":0,
          "waiting_for":0,
          "sprint_id":null,
          "tracker_name":"To-Do"
       }
    }
 ],
 "links":[

 ]
}

getAuthorizedKeys

Parameters (1)

Name Type Description
requestParameters \RequestParameters

Return: array

getAvatar

Get the image representing the user. Users may upload a custom avatar, and the system also provides a default one.

Parameters (1)

Name Type Description
id mixed The database ID or unix name of the user.

Return: mixed

The user's selected avatar image data, or the data for the general avatar if the user has none.

getDetails

Get the detailed profile data for a specific user. Callers may specify the unixName or the databas id in the id parameter.

Parameters (1)

Name Type Description
request \RequestParameters

Related Entities (4)

Return: \UserDetail

A UserDetail structure if the user exists. Otherwise, a NotFoundException (404 response).

Example 1

Retrieve user details for user with unix name of 'mtutty':
  GET http://api.mygforge.tld/user/mtutty/details

{
"address":"",
"address2":"",
"time_zone":"America\/Chicago",
"dateFormat":"Y-M-D",
"phone":"",
"fax":"",
"title":"",
"createDate":"2005-09-12 00:24:33 -0500",
"lastLogin":"2013-07-25 21:34:14 -0500",
"theme":"GForge 5 default theme",
"userText1":null,
"userText2":null,
"userText3":null,
"userText4":null,
"userText5":"gforgegroup",
"userText6":null,
"isRestricted":"N",
"id":5945,
"unixName":"mtutty",
"password":null,
"firstName":"Michael",
"lastName":"Tutty",
"email":"mtutty@gforgegroup.com",
"status":1,
"externalId":null,
"isGroup":"N",
"ccode":"US",
"language":"en",
"img_url":"\/images\/custom_avatars\/5945.jpg",
"html_url":"\/gf\/user\/mtutty\/",
"details_url":"\/api\/user\/mtutty\/details",
"api_url":"\/api\/user\/mtutty"
}

Example 2

Retrieve user details and associated entities, use startDate param, for a full list check getActivityLog
     GET http://next.centos6-restapi.example.com/api/user/gforgeadmin/details?rel=projects,activity&startDate=2014-01-01

{
 "address":null,
 "address2":"",
 "dateFormat":"Y-M-D",
 "phone":"+543413224296",
 "fax":"",
 "title":"",
 "createDate":"2006-06-12 12:37:11 -0300",
 "lastLogin":"2015-02-05 13:53:17 -0300",
 "theme":null,
 "userText1":null,
 "userText2":null,
 "userText3":null,
 "userText4":null,
 "userText5":null,
 "userText6":null,
 "isRestricted":"N",
 "id":101,
 "unixName":"gforgeadmin",
 "password":null,
 "firstname":"GForge Admin",
 "lastname":"User",
 "email":"root@gforge-as-63.example.com",
 "timezone":"GMT",
 "status":1,
 "externalId":null,
 "isGroup":"N",
 "ccode":"US",
 "language":"en   ",
 "img_url":"\/api\/user\/gforgeadmin\/avatar",
 "html_url":"\/#\/user\/gforgeadmin\/",
 "details_url":"\/api\/user\/gforgeadmin\/details",
 "isSiteAdmin":true,
 "api_url":"\/api\/user\/gforgeadmin",
 "projects":[
    {
       "id":52,
       "name":"test_parent_hash",
       "unixName":"test_phash",
       "description":"testing",
       "homepageUrl":"\/gf\/project\/test_phash\/",
       "createDate":"2013-11-06 19:28:17 -0300",
       "isPublic":"N",
       "status":1,
       "isTemplate":"N",
       "templateProjectId":4
    },
    {
       "id":40,
       "name":"test message wall",
       "unixName":"test_wall2",
       "description":"test message wall",
       "homepageUrl":"\/gf\/project\/test_wall2\/",
       "createDate":"2013-05-27 16:25:04 -0300",
       "isPublic":"Y",
       "status":1,
       "isTemplate":"N",
       "templateProjectId":0
    },
    {
       "id":42,
       "name":"test message wall",
       "unixName":"test_wall3",
       "description":"test message wall",
       "homepageUrl":"\/gf\/project\/test_wall3\/",
       "createDate":"2013-05-27 16:25:04 -0300",
       "isPublic":"N",
       "status":1,
       "isTemplate":"N",
       "templateProjectId":0
    },
    {
       "id":43,
       "name":"test_git",
       "unixName":"test_git3",
       "description":"testing",
       "homepageUrl":"\/gf\/project\/test_git3\/",
       "createDate":"2013-06-26 19:33:13 -0300",
       "isPublic":"N",
       "status":1,
       "isTemplate":"N",
       "templateProjectId":0
    },
    {
       "id":47,
       "name":"test_export",
       "unixName":"testing3",
       "description":"test_export",
       "homepageUrl":"\/gf\/project\/testing3\/",
       "createDate":"2013-08-02 05:33:45 -0300",
       "isPublic":"Y",
       "status":1,
       "isTemplate":"N",
       "templateProjectId":0
    },
    {
       "id":49,
       "name":"svn_test1",
       "unixName":"svn_test1",
       "description":"testing",
       "homepageUrl":"\/gf\/project\/svn_test1\/",
       "createDate":"2013-10-17 13:36:17 -0300",
       "isPublic":"N",
       "status":1,
       "isTemplate":"N",
       "templateProjectId":41
    },
    {
       "id":45,
       "name":"test_export",
       "unixName":"testing",
       "description":"test_export",
       "homepageUrl":"\/gf\/project\/testing\/",
       "createDate":"2013-08-02 05:33:45 -0300",
       "isPublic":"N",
       "status":1,
       "isTemplate":"N",
       "templateProjectId":4
    },
    {
       "id":51,
       "name":"test_support",
       "unixName":"test_support",
       "description":"test_support",
       "homepageUrl":"\/gf\/project\/test_support\/",
       "createDate":"2013-10-28 14:35:37 -0300",
       "isPublic":"N",
       "status":1,
       "isTemplate":"N",
       "templateProjectId":4
    },
    {
       "id":24,
       "name":"test_svn",
       "unixName":"test_svn",
       "description":"test_svn",
       "homepageUrl":"\/gf\/project\/test_svn\/",
       "createDate":"2013-06-26 19:33:47 -0300",
       "isPublic":"N",
       "status":1,
       "isTemplate":"N",
       "templateProjectId":3
    },
    {
       "id":6,
       "name":"test message wall",
       "unixName":"test_wall",
       "description":"test message wall",
       "homepageUrl":"\/gf\/project\/test_wall\/",
       "createDate":"2013-05-27 16:25:04 -0300",
       "isPublic":"N",
       "status":1,
       "isTemplate":"N",
       "templateProjectId":4
    },
    {
       "id":48,
       "name":"2testing",
       "unixName":"testing2",
       "description":"testing",
       "homepageUrl":"\/gf\/project\/testing2\/",
       "createDate":"2013-10-15 22:26:11 -0300",
       "isPublic":"N",
       "status":1,
       "isTemplate":"N",
       "templateProjectId":4
    },
    {
       "id":23,
       "name":"test_git",
       "unixName":"test_git",
       "description":"testing",
       "homepageUrl":"\/gf\/project\/test_git\/",
       "createDate":"2013-06-26 19:33:13 -0300",
       "isPublic":"N",
       "status":1,
       "isTemplate":"N",
       "templateProjectId":4
    },
    {
       "id":25,
       "name":"test_cvs",
       "unixName":"test_cvs",
       "description":"testing",
       "homepageUrl":"\/gf\/project\/test_cvs\/",
       "createDate":"2013-06-26 19:34:03 -0300",
       "isPublic":"N",
       "status":1,
       "isTemplate":"N",
       "templateProjectId":2
    },
    {
       "id":26,
       "name":"Parent project",
       "unixName":"parent_prj",
       "description":"Parent project",
       "homepageUrl":"\/gf\/project\/parent_prj\/",
       "createDate":"2013-06-28 18:18:29 -0300",
       "isPublic":"N",
       "status":1,
       "isTemplate":"N",
       "templateProjectId":4
    }
 ],
 "activity":[
    {
       "id":915,
       "date":"2015-02-05 16:23:13 -0300",
       "section":"trackeritem",
       "refId":95,
       "description":null,
       "activityType":"create",
       "url":"\/gf\/project\/test_phash\/tracker\/?action=TrackerItemEdit&tracker_item_id=95",
       "userApiUrl":"\/api\/user\/101",
       "projectApiUrl":"\/api\/project\/",
       "userId":101,
       "projectId":null,
       "project":null,
       "extendedData":{
          "tracker_item_id":95,
          "tracker_id":204,
          "status_id":1,
          "priority":3,
          "submitted_by":101,
          "open_date":"2015-02-05 19:23:12",
          "close_date":null,
          "summary":"Testing 123",
          "details":"\nTesting 123\n",
          "last_modified_date":"2015-02-05 19:23:12",
          "last_modified_by":0,
          "sort_order":0,
          "parent_id":0,
          "has_subitems":false,
          "subitems_count":0,
          "waiting_for":0,
          "sprint_id":null,
          "tracker_name":"Bugs"
       }
    },
    {
       "id":916,
       "date":"2015-02-05 13:26:16 -0300",
       "section":"trackeritem",
       "refId":96,
       "description":null,
       "activityType":"create",
       "url":"\/gf\/project\/test_phash\/tracker\/?action=TrackerItemEdit&tracker_item_id=96",
       "userApiUrl":"\/api\/user\/101",
       "projectApiUrl":"\/api\/project\/",
       "userId":101,
       "projectId":null,
       "project":null,
       "extendedData":{
          "tracker_item_id":96,
          "tracker_id":204,
          "status_id":1,
          "priority":3,
          "submitted_by":101,
          "open_date":"2015-02-05 16:26:16",
          "close_date":null,
          "summary":"Testing tracker item",
          "details":"\nTesting tracker item\n",
          "last_modified_date":"2015-02-05 16:26:16",
          "last_modified_by":0,
          "sort_order":0,
          "parent_id":0,
          "has_subitems":false,
          "subitems_count":0,
          "waiting_for":0,
          "sprint_id":null,
          "tracker_name":"Bugs"
       }
    },
    {
       "id":914,
       "date":"2015-01-27 13:07:04 -0300",
       "section":"wiki",
       "refId":47,
       "description":null,
       "activityType":"update",
       "url":"\/gf\/project\/testing3\/wiki\/?pagename=NewPage",
       "userApiUrl":"\/api\/user\/101",
       "projectApiUrl":"\/api\/project\/",
       "userId":101,
       "projectId":null,
       "project":null,
       "extendedData":{
          "wiki_page_id":213,
          "section":"project",
          "ref_id":47,
          "pagename":"NewPage",
          "flags":0,
          "latest_version":{
          },
          "page_views":0
       }
    },
    {
       "id":913,
       "date":"2015-01-27 13:06:53 -0300",
       "section":"wiki",
       "refId":47,
       "description":null,
       "activityType":"create",
       "url":"\/gf\/project\/testing3\/wiki\/?pagename=NewPage",
       "userApiUrl":"\/api\/user\/101",
       "projectApiUrl":"\/api\/project\/",
       "userId":101,
       "projectId":null,
       "project":null,
       "extendedData":{
          "wiki_page_id":213,
          "section":"project",
          "ref_id":47,
          "pagename":"NewPage",
          "flags":0,
          "latest_version":null,
          "page_views":null
       }
    },
    {
       "id":912,
       "date":"2015-01-27 13:06:48 -0300",
       "section":"wiki",
       "refId":47,
       "description":null,
       "activityType":"update",
       "url":"\/gf\/project\/testing3\/wiki\/?pagename=FrontPage",
       "userApiUrl":"\/api\/user\/101",
       "projectApiUrl":"\/api\/project\/",
       "userId":101,
       "projectId":null,
       "project":null,
       "extendedData":{
          "wiki_page_id":171,
          "section":"project",
          "ref_id":47,
          "pagename":"FrontPage",
          "flags":0,
          "latest_version":{
          },
          "page_views":2
       }
    },
    {
       "id":911,
       "date":"2015-01-22 17:45:54 -0300",
       "section":"trackeritem",
       "refId":94,
       "description":null,
       "activityType":"create",
       "url":"\/gf\/project\/svn_test1\/tracker\/?action=TrackerItemEdit&tracker_item_id=94",
       "userApiUrl":"\/api\/user\/101",
       "projectApiUrl":"\/api\/project\/",
       "userId":101,
       "projectId":null,
       "project":null,
       "extendedData":{
          "tracker_item_id":94,
          "tracker_id":181,
          "status_id":1,
          "priority":3,
          "submitted_by":101,
          "open_date":"1969-12-31 23:59:59",
          "close_date":null,
          "summary":"Testing 123",
          "details":"",
          "last_modified_date":"2015-01-22 20:45:54",
          "last_modified_by":0,
          "sort_order":0,
          "parent_id":0,
          "has_subitems":false,
          "subitems_count":0,
          "waiting_for":0,
          "sprint_id":null,
          "tracker_name":"To-Do"
       }
    }
 ]
}

getGroupUsers

Returns a list of the users members of the group

Parameters (1)

Name Type Description
request \RequestParameters

Return: array

Zero or more UserBasic records.

getPermissions

Get the user's permissions for all projects and sections, or the specific project and section(s) if specified.

Parameters (1)

Name Type Description
request \RequestParameters

Return: \gforge\core\models\api\ProjectPermissionBasic

Zero or more ProjectPermissionBasic structures for the user's permissions.

Name Type Description
projectId int Unique database field for the project
unixName string unix name of the project
value int the max permission level
refId int the id of the associated entity
section string section the permission belongs to

Example 1

Retrieve permissions for user with unix name of 'mtutty':
  GET http://api.mygforge.tld/user/mtutty/permissions

Example 2

Retrieve permissions for user with unix name of 'mtutty' on a specific project:
  GET http://api.mygforge.tld/user/mtutty/permissions?project=myproject

Example 3

Retrieve permissions for user with unix name of 'mtutty' across all projects for specific sections:
  GET http://api.mygforge.tld/user/mtutty/permissions?section=tracker,wiki

getPreference

Get one or more preference values for the specified user (specified in the route).

Parameters (1)

Name Type Description
request \RequestParameters
Sortable
Use the sort_field and sort_dir parameters to control the order in which records are returned.
Pageable
Use the page_size and page_num parameters to control the set of records returned.

Return: \api\UserPreferenceBasic[]|\api\UserPreferenceBasic

Zero or more preference records, matching any specified criteria.

Example 1

List all of the preferences for a specific user (NOTE: You must be this user or a site admin):
GET /api/user/mtutty/preference

{"paging":{"page_size":20,"page_num":1,"sort_field":"id","sort_dir":"asc"},
"items":[
    {
     "preferenceName":"forumsvdt_8310",
     "setDate":"2013-09-27 12:01:43 -0500",
     "preferenceValue":"1380301303|1379696503",
     "user":{...user basic...}
    },
    ... additional items...
  ]
}

Example 2

Retrieve a any preference records for this user where the preferenceName contains the substring "chat-room-".
GET /api/user/mtutty/preference?search=chat-room-

{"paging":{"page_size":20,"page_num":1,"sort_field":"id","sort_dir":"asc"},
"items":[
    {
     "preferenceName":"chat-room-5559",
     "setDate":"2013-09-18 08:44:16 -0500",
     "preferenceValue":"N",
     "user":{...user basic...}
    },
    ... additional items...
  ]
}

Example 3

Retrieve a single preference record that exactly matches "trkquery9878". If the record does not exist, return a fake record with the specified default value of "NOPE"
Note: This usage will not return paged data, only a single record with the existing value or the specified default, or a 404 if no default is specified.
GET /api/user/mtutty/preference/trkquery9878?default=NOPE

{
 "preferenceName":"trkquery9878",
 "setDate":"2014-10-07 16:08:41 -0500",
 "preferenceValue":{
     "tracker_query_id":"9097",
     "show":25,
     "start":0
    },
 "user":{...user basic...}
}

getProjects

Get the projects for which the user is a member.

Parameters (1)

Name Type Description
request \RequestParameters The database ID or unix name of the user.
Sortable
Use the sort_field and sort_dir parameters to control the order in which records are returned.
Pageable
Use the page_size and page_num parameters to control the set of records returned.

Return: \ProjectBasic[]

Zero or more ProjectBasic structures for the user's member projects.

Example 1

Retrieve projects for user with unix name of 'mtutty':
  GET http://api.mygforge.tld/user/mtutty/projects

getQueue

Get the Tracker Item Queue for the specified user.

Parameters (1)

Name Type Description
request \RequestParameters

Return: \StdClass

Zero or more TrackerItemBasic structures, one for each item in the queue. The items are presented in the sort order defined by the user when creating the queue.

getSSOUnixName

Parameters (1)

Name Type Description
request \RequestParameters

Return: (none)

getTrackerItems

Retrieves a list of the user's assigned tracker items

Parameters (1)

Name Type Description
request \RequestParameters
Pageable
Use the page_size and page_num parameters to control the set of records returned.

Return: \StdClass

Zero or more Tracker Items that are assigned to the user

getUser

Searches for users matching criteria, or retrieves a specific user by unixname or database ID.

Parameters (1)

Name Type Description
request \RequestParameters
Sortable
Use the sort_field and sort_dir parameters to control the order in which records are returned.
Pageable
Use the page_size and page_num parameters to control the set of records returned.

Return: array

Zero or more UserBasic records for a search. Zero or one UserBasic record for an id retrieval.

Example 1

Find a user by matching last name:
  GET http://api.mygforge.tld/user?lastName=tutty

  {
     "id":5945,
     "unixName":"mtutty",
     "password":null,
     "firstName":"Michael",
     "lastName":"Tutty",
     "email":"mtutty@gforgegroup.com",
     "status":1,
     "externalId":null,
     "isGroup":"N",
     "ccode":"US",
     "language":"en   ",
     "img_url":"\/images\/custom_avatars\/5945.jpg",
     "html_url":"\/gf\/user\/mtutty\/",
     "details_url":"\/api\/user\/mtutty\/details",
     "api_url":"\/api\/user\/mtutty"
  }

Example 2

Find a user by database ID:
  GET http://api.mygforge.tld/user/5945

  {
     "id":5945,
     "unixName":"mtutty",
     "password":null,
     "firstName":"Michael",
     "lastName":"Tutty",
     "email":"mtutty@gforgegroup.com",
     "status":1,
     "externalId":null,
     "isGroup":"N",
     "ccode":"US",
     "language":"en   ",
     "img_url":"\/images\/custom_avatars\/5945.jpg",
     "html_url":"\/gf\/user\/mtutty\/",
     "details_url":"\/api\/user\/mtutty\/details",
     "api_url":"\/api\/user\/mtutty"
  }

Example 3

List all users in active status:
  GET http://api.mygforge.tld/user?status=1

[
 {
    "id":24507,
    "unixName":"00090007",
    "password":null,
    "firstName":"sadas",
    "lastName":"sadasdsa",
    "email":"sherwun@live.hk",
    "status":1,
    "externalId":null,
    "isGroup":"N",
    "ccode":"HK",
    "language":"tw   ",
    "img_url":"\/images\/stock_avatars\/default.png",
    "html_url":"\/gf\/user\/00090007\/",
    "details_url":"\/api\/user\/00090007\/details",
    "api_url":"\/api\/user\/00090007"
 },
 {
    "id":14468,
    "unixName":"00700",
    "password":null,
    "firstName":"\u5f20",
    "lastName":"\u4e09",
    "email":"50599216@qq.com",
    "status":1,
    "externalId":null,
    "isGroup":"N",
    "ccode":"CN",
    "language":"zh   ",
    "img_url":"\/images\/stock_avatars\/default.png",
    "html_url":"\/gf\/user\/00700\/",
    "details_url":"\/api\/user\/00700\/details",
    "api_url":"\/api\/user\/00700"
 },
 {
    "id":30294,
    "unixName":"008byebye",
    "password":null,
    "firstName":"peng",
    "lastName":"yuan",
    "email":"532549992@qq.com",
    "status":1,
    "externalId":null,
    "isGroup":"N",
    "ccode":"AF",
    "language":"zh   ",
    "img_url":"\/images\/stock_avatars\/default.png",
    "html_url":"\/gf\/user\/008byebye\/",
    "details_url":"\/api\/user\/008byebye\/details",
    "api_url":"\/api\/user\/008byebye"
 },
 {
    "id":12624,
    "unixName":"00veni",
    "password":null,
    "firstName":"Veni",
    "lastName":"Soni",
    "email":"00veerei@gmail.com",
    "status":1,
    "externalId":null,
    "isGroup":"N",
    "ccode":"IN",
    "language":"en   ",
    "img_url":"\/images\/stock_avatars\/default.png",
    "html_url":"\/gf\/user\/00veni\/",
    "details_url":"\/api\/user\/00veni\/details",
    "api_url":"\/api\/user\/00veni"
 },
 {
    "id":12578,
    "unixName":"0873",
    "password":null,
    "firstName":"tom",
    "lastName":"corn",
    "email":"cornererbody@aol.com",
    "status":1,
    "externalId":null,
    "isGroup":"N",
    "ccode":"US",
    "language":"en   ",
    "img_url":"\/images\/stock_avatars\/default.png",
    "html_url":"\/gf\/user\/0873\/",
    "details_url":"\/api\/user\/0873\/details",
    "api_url":"\/api\/user\/0873"
 },
 {
    "id":10770,
    "unixName":"08mobile",
    "password":null,
    "firstName":"Yolanda",
    "lastName":"Olwage",
    "email":"info@08mobile.com",
    "status":1,
    "externalId":"\n",
    "isGroup":"N",
    "ccode":"ZA",
    "language":"en   ",
    "img_url":"\/images\/stock_avatars\/default.png",
    "html_url":"\/gf\/user\/08mobile\/",
    "details_url":"\/api\/user\/08mobile\/details",
    "api_url":"\/api\/user\/08mobile"
 },
 {
    "id":9400,
    "unixName":"0dbfs",
    "password":null,
    "firstName":"Jonathan",
    "lastName":"Breurtner",
    "email":"j.breurtner@dbfullscale.com",
    "status":1,
    "externalId":"\n",
    "isGroup":"N",
    "ccode":"US",
    "language":"en   ",
    "img_url":"\/images\/stock_avatars\/default.png",
    "html_url":"\/gf\/user\/0dbfs\/",
    "details_url":"\/api\/user\/0dbfs\/details",
    "api_url":"\/api\/user\/0dbfs"
 },
 {
    "id":31295,
    "unixName":"1025zhangrui",
    "password":null,
    "firstName":"\u745e",
    "lastName":"\u5f20",
    "email":"1025zhangrui@163.com",
    "status":1,
    "externalId":null,
    "isGroup":"N",
    "ccode":"AF",
    "language":"en   ",
    "img_url":"\/images\/stock_avatars\/default.png",
    "html_url":"\/gf\/user\/1025zhangrui\/",
    "details_url":"\/api\/user\/1025zhangrui\/details",
    "api_url":"\/api\/user\/1025zhangrui"
 },
 {
    "id":29173,
    "unixName":"10822123",
    "password":null,
    "firstName":"sky",
    "lastName":"sky",
    "email":"10822123@qq.com",
    "status":1,
    "externalId":null,
    "isGroup":"N",
    "ccode":"AF",
    "language":"en   ",
    "img_url":"\/images\/stock_avatars\/default.png",
    "html_url":"\/gf\/user\/10822123\/",
    "details_url":"\/api\/user\/10822123\/details",
    "api_url":"\/api\/user\/10822123"
 },
 {
    "id":18564,
    "unixName":"111111",
    "password":null,
    "firstName":"111111",
    "lastName":"111111",
    "email":"marewrch_yuan@yahoo.com.cn",
    "status":1,
    "externalId":null,
    "isGroup":"N",
    "ccode":"CN",
    "language":"zh   ",
    "img_url":"\/images\/stock_avatars\/default.png",
    "html_url":"\/gf\/user\/111111\/",
    "details_url":"\/api\/user\/111111\/details",
    "api_url":"\/api\/user\/111111"
 },
 {
    "id":25551,
    "unixName":"11111111",
    "password":null,
    "firstName":"111",
    "lastName":"111",
    "email":"910111100@qq.com",
    "status":1,
    "externalId":null,
    "isGroup":"N",
    "ccode":"BA",
    "language":"zh   ",
    "img_url":"\/images\/stock_avatars\/default.png",
    "html_url":"\/gf\/user\/11111111\/",
    "details_url":"\/api\/user\/11111111\/details",
    "api_url":"\/api\/user\/11111111"
 },
 {
    "id":29225,
    "unixName":"112clcool",
    "password":null,
    "firstName":"liang",
    "lastName":"cai",
    "email":"112clrwerwecool@gmail.com",
    "status":1,
    "externalId":null,
    "isGroup":"N",
    "ccode":"CN",
    "language":"zh   ",
    "img_url":"\/images\/stock_avatars\/default.png",
    "html_url":"\/gf\/user\/112clcool\/",
    "details_url":"\/api\/user\/112clcool\/details",
    "api_url":"\/api\/user\/112clcool"
 },
 {
    "id":25938,
    "unixName":"1227266822",
    "password":null,
    "firstName":"12",
    "lastName":"213",
    "email":"1227266822@qq.com",
    "status":1,
    "externalId":null,
    "isGroup":"N",
    "ccode":"AF",
    "language":"zh   ",
    "img_url":"\/images\/stock_avatars\/default.png",
    "html_url":"\/gf\/user\/1227266822\/",
    "details_url":"\/api\/user\/1227266822\/details",
    "api_url":"\/api\/user\/1227266822"
 },
 {
    "id":18090,
    "unixName":"123",
    "password":null,
    "firstName":"123",
    "lastName":"123",
    "email":"bai-xewrwerve@foxmail.com",
    "status":1,
    "externalId":null,
    "isGroup":"N",
    "ccode":"AF",
    "language":"en   ",
    "img_url":"\/images\/stock_avatars\/default.png",
    "html_url":"\/gf\/user\/123\/",
    "details_url":"\/api\/user\/123\/details",
    "api_url":"\/api\/user\/123"
 },
 {
    "id":32499,
    "unixName":"1231111",
    "password":null,
    "firstName":"11",
    "lastName":"11",
    "email":"398340908@qq.com",
    "status":1,
    "externalId":null,
    "isGroup":"N",
    "ccode":"US",
    "language":"en   ",
    "img_url":"\/images\/stock_avatars\/default.png",
    "html_url":"\/gf\/user\/1231111\/",
    "details_url":"\/api\/user\/1231111\/details",
    "api_url":"\/api\/user\/1231111"
 },
 {
    "id":28866,
    "unixName":"123123",
    "password":null,
    "firstName":"123123",
    "lastName":"123123",
    "email":"cesrewhiq@gmail.com",
    "status":1,
    "externalId":null,
    "isGroup":"N",
    "ccode":"CN",
    "language":"zh   ",
    "img_url":"\/images\/stock_avatars\/default.png",
    "html_url":"\/gf\/user\/123123\/",
    "details_url":"\/api\/user\/123123\/details",
    "api_url":"\/api\/user\/123123"
 },
 {
    "id":31373,
    "unixName":"1234",
    "password":null,
    "firstName":"aa",
    "lastName":"aa",
    "email":"597730326@qq.com",
    "status":1,
    "externalId":null,
    "isGroup":"N",
    "ccode":"AF",
    "language":"en   ",
    "img_url":"\/images\/stock_avatars\/default.png",
    "html_url":"\/gf\/user\/1234\/",
    "details_url":"\/api\/user\/1234\/details",
    "api_url":"\/api\/user\/1234"
 },
 {
    "id":10145,
    "unixName":"1234554321",
    "password":null,
    "firstName":"Max",
    "lastName":"k",
    "email":"maximkwerwqashin@yandex.ru",
    "status":1,
    "externalId":"\n",
    "isGroup":"N",
    "ccode":"RU",
    "language":"en   ",
    "img_url":"\/images\/stock_avatars\/default.png",
    "html_url":"\/gf\/user\/1234554321\/",
    "details_url":"\/api\/user\/1234554321\/details",
    "api_url":"\/api\/user\/1234554321"
 },
 {
    "id":9377,
    "unixName":"123456",
    "password":null,
    "firstName":"aa",
    "lastName":"aa",
    "email":"orhjagg05@gmail.com",
    "status":1,
    "externalId":"\n",
    "isGroup":"N",
    "ccode":"ES",
    "language":"es   ",
    "img_url":"\/images\/stock_avatars\/default.png",
    "html_url":"\/gf\/user\/123456\/",
    "details_url":"\/api\/user\/123456\/details",
    "api_url":"\/api\/user\/123456"
 },
 {
    "id":18812,
    "unixName":"1234561",
    "password":null,
    "firstName":"123",
    "lastName":"456",
    "email":"thewerlego_mawerster@hotmail.com",
    "status":1,
    "externalId":null,
    "isGroup":"N",
    "ccode":"BB",
    "language":"en   ",
    "img_url":"\/images\/stock_avatars\/default.png",
    "html_url":"\/gf\/user\/1234561\/",
    "details_url":"\/api\/user\/1234561\/details",
    "api_url":"\/api\/user\/1234561"
 }
]

getUserTopProjects

Returns a list of most active projects for a given user

Parameters (1)

Name Type Description
request \RequestParameters

Return: mixed|null

getWall

Get the projects for which the user is a member.

Parameters (1)

Name Type Description
request \RequestParameters
Pageable
Use the page_size and page_num parameters to control the set of records returned.

Return: array

\gforge\core\models\api\WallPostBasic Zero or more WallPostBasic structures for the user's wall posts.

Example 1

Retrieve recent wall posts for user with unix name of 'mtutty':
  GET http://api.mygforge.tld/user/mtutty/wall

POST

postAdmin

Set a user to be a site admin

Parameters (1)

Name Type Description
request \RequestParameters

Return: (none)

postAuthorizedKeys

Parameters (1)

Name Type Description
requestParameters \RequestParameters

Return: (none)

postChange

Parameters (1)

Name Type Description
request \RequestParameters

Return: (none)

postDetails

Update details for the specified user profile. Callers may specify the unixName or the database id in the id parameter.

Parameters (1)

Name Type Description
request \RequestParameters

Return: array

A UserDetail structure with updated values, if the user exists and was updated. If invalid data was provided, then a 400 (Bad Request) with a JSON-encoded list of validation issues. If the user does not exist, a 404 (NotFoundException).

postEmail

First step of user registration. Receives an email address and sends back an email with a token in response

Parameters (1)

Name Type Description
request \RequestParameters

Return: (none)

Example 1

Request creating a user for email 'some@email.com'
POST http://api.mygforge.com/user/0/email
{ "email": "some@email.com" }

postEmailConfirm

Receives a unix name, email and an email change request token. Validates and confirms (persists) the new email for the given user

Parameters (3)

Name Type Description
email \RequestParameters the email to set to the user
unixName \RequestParameters the unix name of the user we want to set the new email to
token \RequestParameters the token we want to validate against the email and also validate it's an active (non expired) token

Return: (none)

Example 1

POST http://api.mygforge.com/api/user/someUnixName/emailconfirm

"email": "some@email.com",
"token":"asljdalksjdioweurnf"

postGroup

Creates a new group

Parameters (1)

Name Type Description
request \RequestParameters

Return: \api\GroupApi|null

postJoinProject

Redeems a project invitation token for the authenticated user. The invitation in the database includes the user, project and role for validation.

Parameters (1)

Name Type Description
request \RequestParameters

Return: \StdClass

postMobile

Enable or disable device push notifications. Requires paramaters "mode" which should be "add" or "remove" and "clientId" which is the device specific Id used to push notifications to the device
Returns 200 (OK) on success, 404 (Not Found) if the user does not exist, 403 (Forbidden) if the user is not allowed, 400 (Bad Request) otherwise with validation failure(s)

Parameters (1)

Name Type Description
request \RequestParameters

Return: array|object|string

postPassword

Change the password for the current user.

Parameters (1)

Name Type Description
request \RequestParameters The database ID or unix name of the user.

Return: (none)

Example 1

POST http://api.mygforge.com/api/user/myuser/password
password=newpasswd

200 OK

postPreference

Deprecated!
Do not use this method for new development. It probably still works, but is no longer supported.

See putPreference.

Parameters (1)

Name Type Description
request \RequestParameters

Return: (none)

postQueue

Add a single Tracker Item to the specified user's queue. This is subject to some rules, which are checked before allowing the action:

  1. Anonymous POSTs are not allowed.
  2. The requesting user must also be the target user, or an admin for the TI's project, or a site admin
  3. The target user must be able to update the specified TI
  4. If the TI is already in the target user's queue, no action will be taken, and no error will be reported.

Parameters (1)

Name Type Description
request \RequestParameters

Return: array

postRegister

Creates a new user

Parameters (1)

Name Type Description
request \RequestParameters

Return: string

Example 1

Create user with unix_name 'usertest1':
POST http://api.mygforge.com/user

"unixName":"usertest1",
"password":"some_password",
"confirmPassword":"some_password",
"email":"user@example.com"
"firstname":"My first name",
"lastname":"My last name",
"ccode":"US" ,
"language":"EN",
"theme":"1",
"timezone":"America/New_York"

postReset

Requests a password reset for a user

Parameters (1)

Name Type Description
request \RequestParameters

Return: (none)

postToken

Based on an email and a token, validates the token, if invalid throws a proper exception

Parameters (2)

Name Type Description
email \RequestParameters the email we want to check the token against
token \RequestParameters the token we want to validate against the email and also validate it's an active (non expired) token

Return: (none)

Example 1

POST http://api.mygforge.com/api/user/0/token

"email": "some@email.com",
"token":"asljdalksjdioweurnf"

postUser

Updates an existing User. See individual field notes for applicability in submitting values.

Parameters (1)

Name Type Description
request \RequestParameters

Return: array|\User

PUT

putGroup

Set the entire set of users in a single call.

Parameters (1)

Name Type Description
request \RequestParameters

Return: (none)

putPreference

Saves a user preference.
Returns 200 (OK) on success, 404 (Not Found) if the user does not exist, 403 (Forbidden) if the user is not allowed, 400 (Bad Request) otherwise with validation failure(s)

Parameters (2)

Name Type Description
preferenceName string The specific preference to retrieve for this user. Should be specified in the route (e.g., api/user/:unixName/preference/:preferenceName).
preferenceValue mixed The value to be recorded. This can be a scalar value (such as 1 or "apple"), or a JSON array or object value. Any submitted value will be serialized to the database.

Return: (none)

putQueue

Set the entire queue for the user in a single call. This is subject to the same rules as postQueue.

Parameters (1)

Name Type Description
request \RequestParameters

Return: (none)

DELETE

deleteAdmin

Remove a user site admin status

Parameters (1)

Name Type Description
request \RequestParameters

Return: (none)

deleteAuthorizedKeys

Parameters (1)

Name Type Description
requestParameters \RequestParameters

Return: (none)

deleteGroup

Remove a group

Parameters (1)

Name Type Description
request \RequestParameters

Return: (none)

deletePreference

Deletes a user preference.
Returns 200 (OK) on success, 404 (Not Found) if the user does not exist, 403 (Forbidden) if the user is not allowed, 400 (Bad Request) otherwise with validation failure(s)

Parameters (2)

Name Type Description
preferenceName string The specific preference to retrieve for this user. Should be specified in the route (e.g., api/user/:unixName/preference/:preferenceName).
preferenceValue mixed The value to be recorded. This can be a scalar value (such as 1 or "apple"), or a JSON array or object value. Any submitted value will be serialized to the database.

Return: (none)

deleteQueue

Remove a single Tracker Item from the specified user's queue. This is subject to the same rules as postQueue, above.

Parameters (1)

Name Type Description
request \RequestParameters

Return: (none)