MyPC Guest User API

Introduction to the MyPC Guest User API 

The MyPC Guest User API is designed to allow you to create your own interface to facilitate the create of Guest Tickets in MyPC Cloud. The key features:  

  • Temporary User Creation: Easily generate guest user accounts with unique identifiers and predefined expiration times based on Guest user Templates. 
  • Access Control: Manage and define the permissions and access levels for guest users by using tags and booking rules.  

Getting Started 

To start using the MyPC Guest User API, you must create Guest User Templates in User Tools.  The steps below explain how to use the API.  

  • API Key Generation: Obtain your API key from the MyPC Admin portal (available to the owner and Super Admin users).  The token will not be displayed on screen and copied to your clipboard.  

*If you lose this token then please generate a new token.  

  • Endpoint Integration: Integrate the API endpoints into your application. 

List All Templates 

 This endpoint will list all the pre-defined Guest templates in your organisation:    

POST ListAllTemplates 

https://subdomain.mypcbooking.com/guestuserapi/guestuserapi/ListAllTemplates 

Body (JSON) 

{"token": "Your Token Here"} 

Response 200 OK 

    { 

        "templateId": "b15f485c-bb39-4918-b4b1-0193b0eee8ce", 

        "name": "1 hr Guest Tickets", 

        "description": "Guest User Template for 1 hr" 

    }, 

    { 

        "templateId": "d53c36e5-3aa9-460a-8d1d-0193f3fd737e", 

        "name": "2hrs guest user", 

        "description": "" 

    } 

If request fails due to incorrect token  

Response 400 Bad Request 

    "errorMessage": "ERR_USER_ORGANIZATION_GUESTUSER_TOKEN_INVALID", 

    "errorExceptionMessage": "", 

    "parameters": [] 

Create Guest User  

This endpoint is used to create the guest ticket based on the templateId retrieved from the ListAllTemplates  

POST CreateGuestUser 

https://subdomain.mypcbooking.com/guestuserapi/guestuserapi/CreateGuestUser 

Body (JSON) 

"token":"Your Token Here", 

 "templateid": "Choose one templateid returned from ListAllTemplates" 

Response 200 OK 

    "userName": "24215", 

    "password": "QuVS17Mm", 

    "expiry": "2024-12-23T15:58:28.9294666Z" 

 The above is the username and password for the guest ticket and when the ticket will expire.  

Failed Requests  

Response 400 Bad Request: 

    "errorMessage": "ERR_USER_ORGANIZATION_GUESTUSER_TOKEN_INVALID", 

    "errorExceptionMessage": "Organization guest user token is invalid", 

    "parameters": [] 

Invalid token supplied or changed.  

Response 400 Bad Request: 

    "errorMessage": "ERR_GUESTUSERTEMPLATE_INVALID", 

    "errorExceptionMessage": "Guest user template is invalid", 

    "parameters": [] 

Incorrect Templateid supplied.  

Once the user has been created successfully, they will be able to login to MyPC Cloud if the ticket is valid.  

Was this article helpful?