createSpeaker

Arguments

GraphQL Mutation

mutation {
  createSpeaker(
    speaker: { firstName: "David Foster", lastName: "Wallace" }
    gatheringId: 232
  ) {
    firstName
    lastName
    id
  }
}

CURL Request

curl -X POST https://api.certaintouchpoint.com/graphql \
-H 'Content-Type: application/graphql' \
-H 'Authorization: Bearer 123abcveryLongAuthorizationToken456def' \
-d '{ mutation { createSpeaker(speaker: { firstName: "David Foster", lastName: "Wallace"}, gatheringId: 232) { firstName lastName id } }'

GraphQL Response

{
  "data": {
    "createSpeaker": {
      "lastName": "Wallace",
      "id": "71111",
      "firstName": "David Foster"
    }
  }
}

SpeakerParams

When creating a speaker firstName and lastName are required.

Providing a Photo/Avatar

You may supply a speaker photo in several ways.

Using the photoUrl attribute, you may supply a URL.

Using the photo attribute you may supply either a Base64 encoded string or an image file using the multipart/form-data content type.

An image file is preferred to the Base64 string as it will be smaller.

To provide the photo as a file

To provide the photo as a file, you should use the multipart/form-data content type.

For example:

curl -X POST https://api.certaintouchpoint.com/graphql \
-H 'Content-Type: application/graphql' \
-H 'Authorization: Bearer 123abcveryLongAuthorizationToken456def' \
-F query='mutation { createSpeaker(speaker: { firstName: "David Foster", lastName: "Wallace", photo: "photo_argument"}, gatheringId: 232) { firstName lastName id }' \
-F photo_argument=@photo.jpg

Notice that the value of the photo attribute is the name of the argument used to refer to the photo file.

To provide the photo file as a Base64 encoded string

To provide the photo file as a Base64 encoded string, prefix the photo string with the information:

data:<mime type>;base64,<encoded data>

For example:

curl -X POST https://api.certaintouchpoint.com/graphql \
-H 'Content-Type: application/graphql' \
-H 'Authorization: Bearer 123abcveryLongAuthorizationToken456def' \
-d '{ mutation { createSpeaker(speaker: { firstName: "David Foster", lastName: "Wallace", photo: "data:image/jpg;base64,alongbase64encodedstring"}, gatheringId: 232) { firstName lastName id } }'