Platforms(Create, Read, Update, Delete)

1. Set up your platform

To create a new Solana Play platform, you'll need to make a POST request to the /platforms endpoint. Make sure to fill in the required fields in the request body.

POST /api/solanaplay/platforms

Request body:

{
  "platformId": "unique-platform-id",
  "name": "platform-name",
  "url": "http://example.com",
  "twitter": "twitter-handle",
  "discordInvite": "http://example.com",
  "image": "image-url",
  "description": "platform-description",
  "category": "platform-category",
  "subcategory": "platform-subcategory",
  "tags": [
    "tag1",
    "tag2",
    "tag3"
  ]
}

Response examples: You will receive response 200(success) :

{
  "success": true,
  "message": "Operation successful",
  "platformId": "unique-platform-id",
  "platCustPub": "platform-custom-publication",
  "platformRefId": "platform-reference-id",
  "createdUTC": 0
}

Or a default message error:

{
  "error": {
    "code": 0,
    "message": "error-message"
  }
}

If successful you will receive a platformId, platCustPub, and platformRefId in the response. Make sure you keep them in a safe place, as you will need them later. If in the event of an error a default message will occur.

2. Manage Platform

Next, you'll need to manage the already created platform. To do this, make a GET request to the platforms/{id} endpoint with your {id}. GET /api/solanaplay/platforms/{id}

{
  "Id": "unique-platform-id"
}

Response examples: You will receive response 200(success) :

{
  "platformId": "unique-platform-id",
  "name": "platform-name",
  "url": "http://example.com",
  "twitter": "twitter-handle",
  "discordInvite": "http://example.com",
  "image": "image-url",
  "description": "platform-description",
  "category": "platform-category",
  "subcategory": "platform-subcategory",
  "tags": [
    "tag-name"
  ],
  "platformRefId": "platform-reference-id",
  "createdUTC": 0,
  "lastModified": "2019-08-24T14:15:22Z"
}

Or a default message error:

{
  "error": {
    "code": 0,
    "message": "error-message"
  }
}

If successful will receive an overview of a single platform with id. If in the event of an error a default message will occur.

3. Update Platform

Next, you'll need to know how to change/update the already created platforms. To do this, make a PUT request to the platforms/{id} endpoint with your {id}. PUT /api/solanaplay/platforms/{id}

{
  "platformId": "unique-platform-id",
  "name": "platform-name",
  "url": "http://example.com",
  "twitter": "twitter-handle",
  "discordInvite": "http://example.com",
  "image": "image-url",
  "description": "platform-description",
  "category": "platform-category",
  "subcategory": "platform-subcategory",
  "tags": [
    "tag-name"
  ],
  "platCustPub": "platform-custom-publication",
  "platCustPriv": "platform-custom-private-key",
  "platRandHex": "platform-random-hex",
  "adminPubkeys": [
    "admin-public-key"
  ],
  "platformRefId": "platform-reference-id",
  "createdUTC": 0,
  "lastModified": "2019-08-24T14:15:22Z"
}

Response examples: You will receive response 200(success) :

{
  "platformId": "unique-platform-id",
  "name": "platform-name",
  "url": "http://example.com",
  "twitter": "twitter-handle",
  "discordInvite": "http://example.com",
  "image": "image-url",
  "description": "platform-description",
  "category": "platform-category",
  "subcategory": "platform-subcategory",
  "tags": [
    "tag-name"
  ],
  "platformRefId": "platform-reference-id",
  "createdUTC": 0,
  "lastModified": "2019-08-24T14:15:22Z"
}

Or a default message error:

{
  "error": {
    "code": 0,
    "message": "error-message"
  }
}

You will receive an updated overview of a platform item with id. If in the event of an error a default message will occur.

4. Delete item

Next, you will need to know how to delete the already created platforms. To do this, make a DELETE request to the /platforms{id} endpoint with your {id}. DELETE /api/solanaplay/platforms/{id} You will receive response 200 :

{
  "platformId": "unique-platform-id",
  "name": "platform-name",
  "url": "http://example.com",
  "twitter": "twitter-handle",
  "discordInvite": "http://example.com",
  "image": "image-url",
  "description": "platform-description",
  "category": "platform-category",
  "subcategory": "platform-subcategory",
  "tags": [
    "tag-name"
  ],
  "platformRefId": "platform-reference-id",
  "createdUTC": 0,
  "lastModified": "2019-08-24T14:15:22Z"
}

Or a default message error:

{
  "error": {
    "code": 0,
    "message": "error-message"
  }
}

If successful you will receive a successful status 200 for the platform deleted. If in the event of an error a default message will occur.

5. Manage all Items

Next, you will need to know how to manage all of the the already created platforms . To do this, make a GET request to the /platforms. GET /api/solanaplay/platforms

{
  "Id": "unique-platform-id"
}

Response examples: You will receive response 200(success) :

[
  {
    "platformId": "unique-platform-id",
    "name": "platform-name",
    "url": "http://example.com",
    "twitter": "twitter-handle",
    "discordInvite": "http://example.com",
    "image": "image-url",
    "description": "platform-description",
    "category": "platform-category",
    "subcategory": "platform-subcategory",
    "tags": [
      "tag-name"
    ],
    "platformRefId": "platform-reference-id",
    "createdUTC": 0,
    "lastModified": "2019-08-24T14:15:22Z"
  }
]

Or a default message error:

{
  "error": {
    "code": 0,
    "message": "error-message"
  }
}

If successful you will receive an overview of all platforms with id. If in the event of an error a default message will occur.