Registration (p:registration)

http://profiles.goabout.com/registration

The Registration resources allows for a Client to create new Users that are not yet validated. The Registration resource will create a new User and send an email to that User in order for it to validate itself.

Example

User has accepted the terms and conditions

$ curl -v -H'Content-Type: application/json' -H'Authorization: Bearer UArtDY9Bpo9Whga2mfd7nIK6vENxp2twtnH7RvPC6xj0jy6' -d'{"email":"foo@bar.com", "name" : "Foo Bar", "termsAccepted": true}' 'http://api.goabout.com/registration'
[ SSL HANDSHAKE CUT OUT ]
> POST /api/registration HTTP/1.1
> User-Agent: curl/7.32.0
> Host: api.goabout.com
> Accept: */*
> Content-Type: application/json
> Authorization: Bearer UArtDY9Bpo9Whga2mfd7nIK6vENxp2twtnH7RvPC6xj0jy6
> Content-Length: 43
>
< HTTP/1.1 200 OK
< Cache-Control: private, no-cache, no-storage
< Content-Type: application/json
< Content-Length: 84
< Server: Jetty(8.1.2.v20120308)
<
{
  "access_token" : "a4DZaPOPgT2AcjEWeEWeW4_DbMxLk-XGPu-kWXr_cm5owqn-",
  "token_type" : "bearer"
}

curl -v -H'Authorization: Bearer a4DZaPOPgT2AcjEWeEWeW4_DbMxLk-XGPu-kWXr_cm5owqn-' 'http://api.goabout.com/'
> GET /api/ HTTP/1.1
> User-Agent: curl/7.32.0
> Host: api.goabout.com
> Accept: */*
> Authorization: Bearer a4DZaPOPgT2AcjEWeEWeW4_DbMxLk-XGPu-kWXr_cm5owqn-
>
< HTTP/1.1 200 OK
< Cache-Control: private, no-cache, no-storage
< Content-Type: application/hal+json
< Content-Length: 2444
< Server: Jetty(8.1.2.v20120308)
<
{ "SNIP" },
  "_embedded" : {
    "http://rels.goabout.com/authenticated-user" : {
      "email" : "foo@bar.com",
      "_links" : {
        "http://rels.goabout.com/favorite-routes" : {
          "href" : "http://api.goabout.com/user/5/favorite-routes"
        },
        "http://rels.goabout.com/trips" : {
          "href" : "http://api.goabout.com/user/5/trips{?start,end}",
          "templated" : true
        },
        "self" : {
          "href" : "http://api.goabout.com/user/5"
        }
      }
    },
    "http://rels.goabout.com/client" : { "SNIP" }
  }
}

User did not (yet) accept terms and conditions

$ curl -v -H'Content-Type: application/json' -H'Authorization: Bearer UArtDY9Bpo9Whga2mfd7nIK6vENxp2twtnH7RvPC6xj0jy6' -d'{"email":"foo@bar.com", "name" : "Foo Bar", "termsAccepted": false}' 'http://api.goabout.com/registration'
[ SSL HANDSHAKE CUT OUT ]
> POST /api/registration HTTP/1.1
> User-Agent: curl/7.32.0
> Host: api.goabout.com
> Accept: */*
> Content-Type: application/json
> Authorization: Bearer UArtDY9Bpo9Whga2mfd7nIK6vENxp2twtnH7RvPC6xj0jy6
> Content-Length: 43
>
< HTTP/1.1 204 NO CONTENT
< Cache-Control: private, no-cache, no-storage
< Content-Type: application/json
< Content-Length: 84
< Server: Jetty(8.1.2.v20120308)
<

Reference

POST

When posting to this resource, a new User (p:user) will be created, with an unvalidated status.

The result of POSTing to this resource is not HAL, and will be a bearer token if-and-only-if the request is valid AND the User has accepted the terms and conditions. If the request is valid, but the User did not accept the terms and conditions, then the registration will be processed, but no Bearer Token will be returned.

Properties

email:EMAIL The e-mail for the new to register User
name:STRING The name for this new User
termsAccepted:BOOLEAN Whether the User has accepted the Terms and Conditions