Add Share

OpenAPI DocumentationClick here to view the OpenAPI documentation for center server data service under device category.

The following content is provided to improve development efficiency, offering example request and response diagrams before code development, helping developers deeply understand business requirements. This is also supplementary to the OpenAPI documentation generated from code comments, elaborating on parts not covered by code comments, thereby reducing code development workload.

Request Path

/main-service/main-api/v1/retail/device/data-acquisition-device/share

Request Structure (Api request)

Fields

TIP
  • deviceId: Device ID, included in device list
  • deviceManage: Sharer username
  • targetUsername Share target username (at least one of targetUsername, targetEmail, targetPhoneNumber must not be empty)
  • targetEmail Share target email (at least one of targetUsername, targetEmail, targetPhoneNumber must not be empty)
  • targetPhoneNumber Share target phone number (at least one of targetUsername, targetEmail, targetPhoneNumber must not be empty)

Example

HTTP: request body application/json
1{
2  "deviceId": "123456",
3  "deviceManage": "admin",
4  "targetUsername": "user1",
5  "targetEmail": "user1@example.com",
6  "targetPhoneNumber": "1234567890"
7}

Illustration

Response Structure (Api response)

Fields

  • data: Response data, this is an optional field, only displays corresponding content when actually having data to return.
TIP
  • error: Error message, this is an optional field, following are possible error messages:
    • Unable to share with oneself: Cannot share with oneself
    • The user corresponding to the shared username does not exist: User corresponding to share username does not exist
    • The user corresponding to the shared email does not exist: User corresponding to share email does not exist
    • The user corresponding to the shared phone number does not exist: User corresponding to share phone number does not exist
    • Sharing users have no personal space: Share users have no personal space
    • Device sharing already exists: Device sharing already exists
    • The data collection device does not exist: Data collection device does not exist
    • The data collection device shared with the user already exists: Data collection device shared with user already exists
    • Incorrect email: Email incorrect
    • Incorrect phone number: Phone number incorrect
    • At least one of targetUsername, targetEmail, and targetPhoneNumber is not empty: At least one of targetUsername, targetEmail and targetPhoneNumber must not be empty

Example

HTTP: response application/json
1{
2  "status": 422,
3  "path": "/main-service/main-api/v1/retail/device/data-acquisition-device/share",
4  "error": "At least one of targetUsername, targetEmail, and targetPhoneNumber is not empty"
5}

Illustration