On this page

    1. Home
    2. API
    3. API Reference
    4. Device
    5. Create Share Code

    Create Share Code

    This endpoint allows the owner of a device to generate a unique sharing code. This code can be provided to another network, allowing them to gain shared access to the device's capabilities without transferring ownership.


    POST /device/create-share-code

    Generate a new device sharing code.

    Request

    POST /device/create-share-code

    Headers:

    {
      "Host": "api.bringyour.com",
      "Content-Type": "application/json",
      "Authorization": "Bearer <YOUR_JWT_TOKEN>"
    }

    Body:

    {
      "client_id": "string",
      "device_name": "string"
    }

    Fields

    FieldTypeDescription
    client_idstringRequired. The unique UDID of the client device to be shared.
    device_namestringRequired. A human-readable name for the device that will be shown to the guest network.

    Response

    200 Success

    Status: 200 OK Content-Type: application/json

    {
      "share_code": "string",
      "error": {
        "message": "string"
      }
    }

    Fields

    FieldTypeDescription
    share_codestringThe alphanumeric code to give to the guest network.
    errorobjectAn error object if the code generation failed.
    error.messagestringA descriptive message explaining why the share could not be initiated.

    Example

    HTTP Request

    POST /device/create-share-code HTTP/1.1
    Host: api.bringyour.com
    Content-Type: application/json
    Authorization: Bearer YOUR_JWT_TOKEN
     
    {
      "client_id": "c73040c1-0000-0000-0000-000000000000",
      "device_name": "Living Room AP"
    }

    Successful HTTP Response

    {
      "share_code": "SHARE-1234-5678",
      "error": null
    }


    Powered by Sudoc v2.5.0
    Hide table of contents