Emails - Huddle/huddle-apis GitHub Wiki

SAML Partner Emails

Summary

In addition to wildcard emails for the SAML partner, individual emails can be added to the SAML partner's domain.

Currently this endpoint can only be consumed with admin permissions.

Operations

Operation
Creating new email address within partner
Retrieve email addresses for partner
Deleting an email address from partner

Creating new email address within partner

You can add a new email address to a SAML partner domain with a POST request to the emails endpoint.

Request

POST /samlpartners/123/emails HTTP/1.1
Content-Type: application/vnd.huddle.data+json
Authorization: Bearer frootymcnooty/vonbootycherooty
{
    "email":"[email protected]"
}

Response

If POST is successful, this method will return a 201 Created with the Location header pointing to the created email.

HTTP/1.1 201 Created
Location: /samlpartners/123/emails/1234

Other Responses

Case Response
Invalid authorization token 401 Unauthorized
Actor does not have admin permission 403 Forbidden
Requested SAML Partner Id does not exist 404 Not Found
Specified email address already exists within the same or different SAML Partner 409 Conflict

Retrieve email addresses for partner

This resource supports getting a paged list of email addresses associated with the partner. With the option of filtering on the email addresses.

Request

GET /samlpartners/123/emails HTTP/1.1
Accept: application/json
Authorization: Bearer frootymcnooty/vonbootycherooty

Request Parameters

Parameters are query string parameters that are used to page and filter the results, e.g.

GET /samlpartners/123/emails?pagesize=20&skip=0&filter=bob
Parameter Default Value Additional Notes
pagesize 20 The maximum number of elements to return, between 1 - 100.
skip 0 The number of elements to skip.
filter The string to filter the results on

Response

HTTP/1.1 200 OK
Content-Type: application/json
[
  {
    "emailId": 1,
    "email": "[email protected]"
  },
  {
    "emailId": 2,
    "email": "[email protected]"
  }
]

Deleting an email address from partner

This resource supports deleting individual emails. To delete an email, send a DELETE request to the email's self URI.

Request

DELETE /samlpartners/123/emails/1234 HTTP/1.1
Authorization: Bearer frootymcnooty/vonbootycherooty

Response

If the delete is successful, this method will return an empty response with an 204 No Content status code

HTTP/1.1 204 No Content

Other Responses

Case Response
Invalid authorization token 401 Unauthorized
Actor does not have admin permission 403 Forbidden
Requested SAML Partner Id does not exist 404 Not Found
Specified email id does not exist 404 Not Found
Specified email id exists within different SAML Partner 404 Not Found