On this page

    1. Home
    2. API
    3. API Reference
    4. Device
    5. Device Add

    Device Add

    This endpoint allows you to add a new device to your network by providing a valid share_code or adopt_code.


    POST /device/add

    Add a device to the authenticated network.

    Request

    POST /device/add

    Headers:

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

    Body:

    {
      "code": "string"
    }

    Fields

    FieldTypeDescription
    codestringRequired. The share code or adopt code for the device.

    Response

    200 Success

    Status: 200 OK

    Content-Type: application/json

    {
      "code_type": "share",
      "code": "string",
      "device_name": "string",
      "associated_network_name": "string",
      "client_id": "udid",
      "duration_minutes": 0,
      "error": {
        "message": "string"
      }
    }

    Fields

    FieldTypeDescription
    code_typestringType of code processed: share or adopt.
    codestringThe alphanumeric code that was processed.
    device_namestringName of the device being added.
    associated_network_namestringShare codes only. Name of the network sharing the device.
    client_idstringShare codes only. Unique identifier assigned to the added client.
    duration_minutesnumberTime limit for the association in minutes, if applicable.
    errorobjectDetails if the addition failed (can be null).

    Example

    HTTP Request

    POST /device/add HTTP/1.1
    Host: api.bringyour.com
    Content-Type: application/json
    Authorization: Bearer YOUR_JWT_TOKEN
     
    {
      "code": "SHARE-1234-5678"
    }

    Successful HTTP Response

    {
      "code_type": "share",
      "code": "SHARE-1234-5678",
      "device_name": "Shared Laptop",
      "client_id": "c73040c1-0000-0000-0000-000000000000"
    }


    Powered by Sudoc v2.5.0
    Hide table of contents