Version User Scope of changes
Jul 28 2008, 12:26 PM EDT devin_wetpaint 1 word added, 1 word deleted
Jul 21 2008, 1:57 PM EDT smcquade

Changes

Key:  Additions   Deletions
HTTP MethodURIReturns
POST /NamespaceService/createNamespace.doA string representing the new namespace name.
Overview:

To allow the creation and maintenance of multiple namespaces, we have introduced two changes to our server API. First, we have added a new API call to programmatically create namespaces associated with a developer key. Second, we have modified the user role change API call to allow the association of your users with new namespaces.

Once one of your users has been logged in via the UserService.login API call, their ticket may be used to give them access to all namespaces associated with your developer key. It is not necessary or desirable to log them in individually to each namespace. However, your users do not automatically have a role on all your namespaces. It is necessary to grant your usersspecific roles on each namespace for which you would like to grant them access. The preferred mechanism for doing this is the UserService.changeRole API.

NAMESPACE CREATION


This API call creates a new content namespace. The primary argument to this call is a namespaceId. Injected will incorporate this identifier into the resulting namespace; however to guarantee uniqueness, the namespace will likely differ from your identifier. You should parse the response from this call to determine the actual namespace to use in future calls.

The createNamespace call requires a developer signature, similar to the UserService calls. Whereas the signature for the UserService calls includes the userId of the user in question, the createNamespace call includes the namespaceId, as included in the namespace.namespaceId parameter.


ROLE CHANGE

When you log in users to Injected using the UserService.login API call, you grant them access to a particular namespace (as specified by the ns and user.role parameters). By default, users will not have a role on any namespaces other than the one specified in this API call. Any calls to these namespaces using their ticket will result in an INVALID_ROLE failure.

The role change API call has been updated to allow you to grant your users access to newly created namespaces. Simply call the role change API to specify the desired role in the new namespace.


POST /NamespaceService/createNamespace.do


Common Parameters


namespace.namespaceId Identifier to be used for the new namespace. The actual resulting namespace will differ from this.
cred.ts The current time, expressed as the number of seconds since January 1, 1970 12:00 am GMT. This must be within five minutes of Wetpaint server time.
cred.sig Developer credential signature. This is calculated as the HMAC-SHA-1 hash of the developer key (the key parameter), the namespace ID (the namespace.namespaceId parameter, described above), and the current timestamp (the cred.ts parameter). The key used by the HMAC-SHA-1 algorithm should be the developer secret.

For example, in PHP:

$sig = hash_hmac( "sha1", $developer_key . $user_id$namespace_id . time(), $developer_secret, FALSE );
output Currently only api output is supported for this call.
Example Request ( required parameters in red ):
Example Response:

<response><namespace>wp-injected-yoursite</namespace></response>