Sugar Network/API: Difference between revisions

Line 165: Line 165:
* ''player'' can be updated only by a user who is associated with it.
* ''player'' can be updated only by a user who is associated with it.


  POST /player/<GUID>/'''send'''
  POST /player/<GUID>/'''message'''


Send private message to the ''player''.
Send private message to the ''player''.
Line 181: Line 181:
:* {{Code|title}}, ''str'', ''read'', ''write'' only for the team members<br>one line title;
:* {{Code|title}}, ''str'', ''read'', ''write'' only for the team members<br>one line title;
description;
description;
:* {{Code|creator}}, ''guid'', ''read''<br>the ''player'' who created the object;
:* {{Code|type}}, ''str'', ''read'', ''write'' only for the team members<br>the project type:
:* {{Code|type}}, ''str'', ''read'', ''write'' only for the team members<br>the project type:
:** {{Code|general}},
:** {{Code|general}},
Line 197: Line 196:
:** votes given to related objects if theirs ''respect'' property is empty;
:** votes given to related objects if theirs ''respect'' property is empty;
:* {{Code|vote}}, ''bool'', ''read'', ''write''<br>did url requester voted for the current object or not.
:* {{Code|vote}}, ''bool'', ''read'', ''write''<br>did url requester voted for the current object or not.
Many-to-many relations:
:* ''team'', relates to ''player''.


Actions:
Actions:
Line 226: Line 222:


Properties:
Properties:
:* {{Code|project}}, ''guid'', ''read''<br>the ''project'' this object belongs to;
:* {{Code|title}}, ''str'', ''read'', ''write'' only for creator<br>one line title;
:* {{Code|title}}, ''str'', ''read'', ''write'' only for creator<br>one line title;
:* {{Code|creator}}, ''guid'', ''read''<br>the ''player'' who created the object;
:* {{Code|respect}}, ''guid'', ''read'', ''create''<br>what ''player'' needs to be respected on getting vote to this object, if empty, the ''project'' itself will be voted;
:* {{Code|solution}}, ''guid'', ''read'', ''write'' only by creator<br>the ''solution'' which solves the object.
:* {{Code|solution}}, ''guid'', ''read'', ''write'' only by creator<br>the ''solution'' which solves the object.


Calculated properties:
Calculated properties:
:* {{Code|reputation}}, ''int'', ''read''<br>current object's reputation;
:* {{Code|vote}}, ''bool'', ''read'', ''write''<br>did url requester voted for the current object or not;
:* {{Code|implementation_status}}, ''str'', ''read''<br>if ''question'' has an associated ''objective'', this ''objective'''s status is a status of the ''question'', otherwise the property is empty.
:* {{Code|implementation_status}}, ''str'', ''read''<br>if ''question'' has an associated ''objective'', this ''objective'''s status is a status of the ''question'', otherwise the property is empty.


Line 242: Line 235:


Properties:
Properties:
:* {{Code|title}}, ''str'', ''read'', ''write'' only for creator<br>one line title;
:* {{Code|project}}, ''guid'', ''read''<br>the ''project'' this object belongs to;
:* {{Code|creator}}, ''guid'', ''read''<br>the ''player'' who created the object;
:* {{Code|title}}, ''str'', ''read'', ''write'' only for creator<br>one line title.
:* {{Code|respect}}, ''guid'', ''read'', ''create''<br>what ''player'' needs to be respected on getting vote to this object, if empty, the ''project'' itself will be voted.


Calculated properties:
Calculated properties:
:* {{Code|reputation}}, ''int'', ''read''<br>current object's reputation;
:* {{Code|vote}}, ''bool'', ''read'', ''write''<br>did url requester voted for the current object or not;
:* {{Code|implementation_status}}, ''str'', ''read''<br>if ''idea'' has an associated ''objective'', this ''objective'''s status is a status of the ''idea'', otherwise the property is empty.
:* {{Code|implementation_status}}, ''str'', ''read''<br>if ''idea'' has an associated ''objective'', this ''objective'''s status is a status of the ''idea'', otherwise the property is empty.


Line 257: Line 247:


Properties:
Properties:
:* {{Code|project}}, ''guid'', ''read''<br>the ''project'' this object belongs to;
:* {{Code|title}}, ''str'', ''read'', ''write'' only for creator<br>one line title;
:* {{Code|title}}, ''str'', ''read'', ''write'' only for creator<br>one line title;
:* {{Code|creator}}, ''guid'', ''read''<br>the ''player'' who created the object;
:* {{Code|respect}}, ''guid'', ''read'', ''create''<br>what ''player'' needs to be respected on getting vote to this object, if empty, the ''project'' itself will be voted;
:* {{Code|solution}}, ''guid'', ''read'', ''write'' only by creator<br>the ''solution'' which solves the object.
:* {{Code|solution}}, ''guid'', ''read'', ''write'' only by creator<br>the ''solution'' which solves the object.


Calculated properties:
Calculated properties:
:* {{Code|reputation}}, ''int'', ''read''<br>current object's reputation;
:* {{Code|vote}}, ''bool'', ''read'', ''write''<br>did url requester voted for the current object or not;
:* {{Code|implementation_status}}, ''str'', ''read''<br>if ''problem'' has an associated ''objective'', this ''objective'''s status is a status of the ''problem'', otherwise the property is empty.
:* {{Code|implementation_status}}, ''str'', ''read''<br>if ''problem'' has an associated ''objective'', this ''objective'''s status is a status of the ''problem'', otherwise the property is empty.
Actions:
* [[#Wiki_actions|Wiki related actions]] to manage object description.
=== solution ===
The solution for ''question''/''idea''/''problem'' objects.
Properties:
:* {{Code|creator}}, ''guid'', ''read''<br>the ''player'' who created the object;
:* {{Code|respect}}, ''guid'', ''read'', ''create''<br>what ''player'' needs to be respected on getting vote to this object, if empty, the ''project'' itself will be voted.
Calculated properties:
:* {{Code|reputation}}, ''int'', ''read''<br>current object's reputation;
:* {{Code|vote}}, ''bool'', ''read'', ''write''<br>did url requester voted for the current object or not.


Actions:
Actions:
Line 288: Line 260:


Properties:
Properties:
:* {{Code|title}}, ''str'', ''read'', ''write'' only for creator<br>one line title;
:* {{Code|project}}, ''guid'', ''read''<br>the ''project'' this object belongs to;
:* {{Code|creator}}, ''guid'', ''read''<br>the ''player'' who created the object;
:* {{Code|title}}, ''str'', ''read'', ''write'' only for creator<br>one line title.
:* {{Code|respect}}, ''guid'', ''read'', ''create''<br>what ''player'' needs to be respected on getting vote to this object, if empty, the ''project'' itself will be voted;
:* {{Code|reputation}}, ''int'', ''read''<br>current object's reputation;
:* {{Code|vote}}, ''bool'', ''read'', ''write''<br>did url requester voted for the current object or not;


Actions:
Actions:
Line 300: Line 269:


Properties:
Properties:
:* {{Code|title}}, ''str'', ''read'', ''write'' only for creator<br>one line title;
:* {{Code|project}}, ''guid'', ''read''<br>the ''project'' this object belongs to;
:* {{Code|creator}}, ''guid'', ''read''<br>the ''player'' who created the object;
:* {{Code|title}}, ''str'', ''read'', ''write'' only for creator<br>one line title.
:* {{Code|respect}}, ''guid'', ''read'', ''create''<br>what ''player'' needs to be respected on getting vote to this object, if empty, the ''project'' itself will be voted;
:* {{Code|reputation}}, ''int'', ''read''<br>current object's reputation;
:* {{Code|vote}}, ''bool'', ''read'', ''write''<br>did url requester voted for the current object or not;


Actions:
Actions:
Line 316: Line 282:
: Attached object content with application/octet-stream MIME type.
: Attached object content with application/octet-stream MIME type.


  PUT /<RESOURCE>/<GUID>/'''exhibit'''
  PUT /gallery/<GUID>/'''exhibit'''


Put new attached object. Only object creator can use it.
Put new attached object. Only object creator can use it.
Line 329: Line 295:


Properties:
Properties:
:* {{Code|title}}, ''str'', ''read'', ''write'' only for the team members<br>one line title;
:* {{Code|project}}, ''guid'', ''read''<br>the ''project'' this object belongs to;
:* {{Code|creator}}, ''guid'', ''read''<br>the ''player'' who created the object;
:* {{Code|title}}, ''str'', ''read'', ''write'' only for the team members<br>one line title.
:* {{Code|respect}}, ''guid'', ''read'', ''create''<br>what ''player'' needs to be respected on getting vote to this object, if empty, the ''project'' itself will be voted;
:* {{Code|reputation}}, ''int'', ''read''<br>current object's reputation;
:* {{Code|vote}}, ''bool'', ''read'', ''write''<br>did url requester voted for the current object or not;


Actions:
Actions:
Line 339: Line 302:


=== release ===
=== release ===
Properties:
:* {{Code|project}}, ''guid'', ''read''<br>the ''project'' this object belongs to;
:* {{Code|version}}, ''str'', ''read''<br>release version;
:* {{Code|stability}}, ''str'', ''read''<br>release stability level, the same as for Zero Install/Sweets.
Actions:
* [[#Wiki_actions|Wiki related actions]] to manage release notes.
=== report ===
Properties:
:* {{Code|release}}, ''guid'', ''read''<br>the ''release'' this object belongs to.
Actions:
: Only read-only [[#Common_actions|common]] actions.
PUT /report/<GUID>/'''logs'''
Attach logs to the ''report''.
Sends:
: Attached logs with application/octet-stream MIME type.
Events:
: {{Code|type: update}}
GET /report/<GUID>/'''logs'''
Get ''report'' attached logs.
Receives:
: Attached logs with application/octet-stream MIME type.
=== solution ===
The solution for ''question''/''idea''/''problem'' objects.
Properties:
:* {{Code|resource}}, ''str'', ''read''<br>the type of resource this solution is for;
:* {{Code|object}}, ''guid'', ''read''<br>the resource object this solution is for.
Actions:
* [[#Wiki_actions|Wiki related actions]] to manage object description.


=== comment ===
=== comment ===
Properties:
:* {{Code|resource}}, ''str'', ''read''<br>the type of resource this comment is about;
:* {{Code|object}}, ''guid'', ''read''<br>the resource object this comment is about;
:* {{Code|text}}, ''str'', ''read'', ''write'' only for creator<br>comment text.


=== event ===
=== event ===
Properties:
: No specific properties except the [[#Common_events|common]] ones.
Actions:
: Only read-only [[#Common_actions|common]] actions.


== Changelog ==
== Changelog ==