API:people/join
From wiki.groundcrew.us
You're reading the API pages for Groundcrew
Allows a new user to join your Groundcrew squad as an agent. After joining, the person will receive confirmation notices via email and SMS, and will need to confirm these points of contact and provide a location before they show up on the map.
Contents |
[edit] URL
http://wwww.groundcrew.us/api/squad/{squad_id}/people/join
[edit] HTTP Method(s)
POST
[edit] Parameters
| Required | Name | Type | Description |
|---|---|---|---|
| required | api_key | string | The authentication key associated with an organization. |
| name | string | The name of the person joining. | |
| m_sysid | string | A mobile phone number. | |
| e_sysid | string | An email address. | |
| optional | go | string | On success, this method will redirect to this absolute URL. Defaults to request referrer. |
| login | string | If the mobile number or email address has already been registered, this method will issue a redirect to this absolute URL. Defaults to your squad's Groundcrew login page. |
[edit] Response
[edit] Success
If this method was called by a referrer, it will issue a redirect to either that request referrer or to a URL in the optional go parameter. go can wither be an absolute URL or a short url relative to the squad (for instance, "confirm" will redirect to your squad's confirm page).
If this method was called programmatically (e.g. via AJAX), it will return a 200 status code with a success message in the response body.
[edit] Error
For most errors, this method will return a 400 or 401 status code.
If the mobile number or email address has already been registered and:
- If this method was called by a referrer, it will redirect to your squad's Groundcrew login page or a URL in the optional login parameter. Additionally, an error message will be set to a cookie named flash.
- If this method was called programmatically (e.g. via AJAX), it will return a 400 status code with a message indicating that the user must login.
[edit] Example
curl -F "api_key={key}&m_sysid={8001234567}&e_sysid={joe@groundcrew.us}" \
http://wwww.groundcrew.us/api/squad/{squad_id}/people/join

