createPost

tl;dr: Create a Post

const mutation = /* GraphQL */ `
  mutation($model: CreatePostInput!) {
    createPost(model: $model) {
      success
      post {
        id
        color
        coordinates {
          latitude
          longitude
        }
        isPrivate
        isPublic
        manager {
          ... on UserAssignee {
            userId
          }
        }
        messages {
          attachments {
            id
            fileId
            fileName
          }
          author {
            firstName
            lastName
          }
          authoredById
          body
          createdAt
          id
          savedViews {
            coordinates {
              latitude
              longitude
            }
            bearing
            pitch
            zoom
          }
          source
        }
        number
        permissions {
          assignee {
            ... on UserAssignee {
              userId
            }
          }
          scope
        }
        showOnLayers {
          color
          discipline {
            id
            name
          }
          id
          level {
            id
            name
          }
          name
        }
        subject
        tags {
          isPrimary
          tag {
            id
            name
          }
        }
      }
    }
  }
`;

const body = {
  query: mutation,
  variables: {
    model: {
      color: "#DD2C00", // Hex Color Code for Psot
      coreId: "PROJECT_ID", // Your Project's ID
      latitude: 32.54417017820198,
      longitude: -96.36386596007037,
      permissions: [
        {scope: "MANAGE", userId: "CREATED_BY_USER_ID"}
      ],
      messages: [],
      showOnLayerIds: ["7087"],
      savedView: {
        latitude: 32.544167917161815,
        longitude: -96.36654816908501,
        layerIds: ["7087"],
        pitch:0,
        zoom:17
      },
      subject: "New Post",
      tags:[]
    }
  }
};

fetch("https://atlasapigateway.bluebeam.com/graphql", {
  "headers": {
    "accept": "application/json, text/plain, */*",
    "authorization": "Bearer YOUR_ACCESS_TOKEN",
  },
  "body": body,
  "method": "POST",
  "mode": "cors",
  "credentials": "include"
});

Request

Mutation for a project's accessCode by the project's id.

mutation($model: CreatePostInput!) {
	createPost(model: $model) {
		success
		post {
			id
			color
			coordinates {
				latitude
				longitude
			}
			isPrivate
			isPublic
			manager {
				... on UserAssignee {
					userId
				}
			}
			messages {
				attachments {
					id
					fileId
					fileName
				}
				author {
					firstName
					lastName
				}
				authoredById
				body
				createdAt
				id
				savedViews {
					coordinates {
						latitude
						longitude
					}
					bearing
					pitch
					zoom
				}
				source
			}
			number
			permissions {
				assignee {
					... on UserAssignee {
						userId
					}
				}
				scope
			}
			showOnLayers {
				color
				discipline {
					id
					name
				}
				id
				level {
					id
					name
				}
				name
			}
			subject
			tags {
				isPrimary
				tag {
					id
					name
				}
			}
		}
	}
}

Variables

NameType
modelCreatePostInput

Response

Returns the project's access code.

{
  "data":{
    "createPost":{
      "success":true,
      "post":{
        "id":"c2b7f354-985c-4517-a80a-0b3a14da4cd1",
        "color":"#DD2C00",
        "coordinates":{
          "latitude":32.544170178202,
          "longitude":-96.3638659600704
        },
        "isPrivate":false,
        "isPublic":true,
        "manager":{
          "userId":"CREATED_BY_USER_ID"
        },
        "messages":[
          {
            "attachments":[
              
            ],
            "author":{
              "firstName":"CREATED_BY_USER_FIRS_NAME",
              "lastName":"CREATED_BY_USER_LAST_NAME"
            },
            "authoredById":"CREATED_BY_USER_ID",
            "body":"created New Post",
            "createdAt":"2020-09-01T15:21:21.950Z",
            "id":"ea59be2b-1eb5-4b82-9054-60f79d1d17ed",
            "savedViews":[
              {
                "coordinates":{
                  "latitude":32.5441679171618,
                  "longitude":-96.366548169085
                },
                "bearing":0,
                "pitch":0,
                "zoom":17
              }
            ],
            "source":"SYSTEM"
          }
        ],
        "number":71,
        "permissions":[
          {
            "assignee":{
              "userId":"CREATED_BY_USER_ID"
            },
            "scope":"MANAGE"
          }
        ],
        "showOnLayers":[
          {
            "color":"#212121",
            "discipline":{
              "id":1,
              "name":"Architectural"
            },
            "id":"7087",
            "level":{
              "id":88656,
              "name":"Level 1"
            },
            "name":"Floor Plan"
          }
        ],
        "subject":"Test",
        "tags":[
          
        ]
      }
    }
  }
}