Users API

Endpoint: http://geocommons.com/users

Description: Used to create, modify and delete GeoCommons and GeoIQ users.

HTTP Methods Available: GET POST PUT DELETE

URL Summary:

TaskURLFormatsHTTP METHOD
createhttp://geocommons.com/users.{format}jsonPOST
retrievehttp://geocommons.com/users/{username}.{format}jsonGET
modifyhttp://geocommons.com/users/{username}.{format}jsonPUT
deletehttp://geocommons.com/users/{username}.{format}jsonDELETE

Create User

Authentication:

Authentication not required for GeoCommons. GeoIQ appliances where user sign-up is disabled require basic authentication by an administrative user account.

Required Parameters:

ParameterDescriptionExample
user[login]username that the user will login withuser[login]=johndoe
user[password]password the user will login withuser[password]=s3curepassword
user[password_confirmation]sample information as password the user will login withuser[password_confirmation]=s3curepassword
user[email]users email addressuser[email]=john@example.com
user[fullname]full name of the person whose account it is“user[fullname]=John G. Doe”

Optional Parameters: (none)

Returns:

TypeDescriptionExample
user objectreturns id, login,email of created userUser}

Curl Examples:

curl -i -X POST -d "user[login]=sampleapiuser" -d "user[password]=password" -d "user[password_confirmation]=password" -d "user[email]=sampleapiuser@example.com" -d "user[fullname]=Sample A. User" http://geocommons.com/users.json

Retrieve User Info

Authentication:

Not required, but to get full user information basic authentication is required and the account must also be an administrator

Required Parameters: (none)

Optional Parameters: (none)

Curl Examples:

curl -u "username:password" http://geocommons.com/users/kate.json

Modify User

Authentication:

Must use basic authentication utilizing the account of the user being modified or an administrative account

Required Parameters: (none)

Optional Parameters:

ParameterDescriptionExample
user[password]password the user will login withuser[password]=s3curepassword
user[password_confirmation]sample information as password the user will login with must be used in conjunction with user[password] if modifying a users passworduser[password_confirmation]=s3curepassword
user[email]users email addressuser[email]=john@example.com
user[fullname]full name of the person whose account it is“user[fullname]=John G. Doe”

Curl Examples:

curl -i -u "username:password" -X PUT -d "user[email]=anotheremail@example.com" http://geocommons.com/users/sampleapiuser.json
curl -i -u "username:password" -X PUT -d "user[password]=newpassword" -d "user[password_confirmation]=newpassword" http://geocommons.com/users/sampleapiuser.json

Groups API

Endpoint: http://geocommons.com/groups

Description: The Groups API allows creation of groups of users to allow for granular access control to maps, data and analysis within GeoIQ.

HTTP Methods Available: GET, POST, PUT, DELETE

URL Summary:

TaskURLFormatsHTTP METHOD
createhttp://geocommons.com/groups.{format}jsonPOST
add userhttp://geocommons.com/groups/{id}/users.{format}jsonPOST
list group usershttp://geocommons.com/groups/{id}/users.{formatjsonGET
deletehttp://geocommons.com/groups/{id}.{format}jsonDELETE

Create Group

Authentication:

Basic authentication is required for both GeoCommons and GeoIQ appliances. The account being used must also be an administrator.

Required Parameters:

ParameterDescriptionExample
group[name]the name of the groupgroup[name]=thegroup

Optional Parameters: (none)

TypeDescriptionExample
Locationreturns the URI of the file requestedhttp://geocommons.com/groups/23360.json

Curl Examples:

curl -u "user:password" -X POST -i -d "group[name]=example_group" http://geocommons.com/groups.json

Add User to Group

Authentication:

Basic authentication is required for both GeoCommons and GeoIQ appliances. The account being used must also be an administrator.

Required Parameters:

ParameterDescriptionExample
“username”user to be added to the groupkate

Optional Parameters: (none)

Curl Examples:

curl -i -u "user:password" -d "kate" -X  POST http://geocommons.com/groups/23150/users.json

List Group Users

Authentication:

Basic authentication is required for both GeoCommons and GeoIQ appliances. The account being used must also be an administrator.

Required Parameters: (none)

Optional Parameters: (none)

Curl Examples:

curl -u "user:password" http://geocommons.com/groups/23150/users.json

Delete Group

Authentication:

Basic authentication is required for both GeoCommons and GeoIQ appliances. The account being used must also be an administrator.

Required Parameters: (none)

Optional Parameters: (none)

Curl Examples:

curl -u "user:password" -X DELETE http://geocommons.com/groups/23150.json
 

Comments are closed.