API¶
Session/Create¶
Creates a session, which can be authenticated via the EmailPassword/Login method.
Parameters
- None
Note
As of 3rd October 2013 Session/Create still needs the protocolVersion and the value must be 4. Reference
Returns
A ModuleResult with a single Result with a SessionGUID
<PortalResult Duration="12">
<ModuleResults>
<ModuleResult Fullname="Portal" Duration="0" Count="1">
<Results>
<Result FullName="CHAOS.Portal.DTO.Standard.Session">
<SessionGUID>47c72c3c-9126-9549-8517-340c4275e22b</SessionGUID>
<UserGUID>c0b231e9-7d98-4f52-885e-af4837faa352</UserGUID>
<DateCreated>03-10-2013 14:00:20</DateCreated>
<DateModified>03-10-2013 14:00:20</DateModified>
</Result>
</Results>
</ModuleResult>
</ModuleResults>
</PortalResult>
See also
EmailPassword/Login¶
Parameters
- email the user’s email
- password the user’s password
- sessionGUID the GUID of a recently created session
Returns
CHAOS.Portal.Authentication.Exception.LoginException on error and CHAOS.Portal.DTO.Standard.UserInfo on success
http://api.danskkulturarv.dk/EmailPassword/Login?email=test@example.org&password=mysecret
<PortalResult Duration="23">
<ModuleResults>
<ModuleResult Fullname="EmailPassword" Duration="0" Count="1">
<Results>
<Result FullName="CHAOS.Portal.DTO.Standard.UserInfo">
<GUID>80d15fb4-c1fb-9445-89c6-1a398cbd85e5</GUID>
<SystemPermissions>2</SystemPermissions>
<Email>admin@danskkulturarv.dk</Email>
<SessionDateCreated>03-10-2013 14:25:42</SessionDateCreated>
<SessionDateModified>03-10-2013 14:26:14</SessionDateModified>
</Result>
</Results>
</ModuleResult>
</ModuleResults>
</PortalResult>
Object/SetPublishSettings¶
Publishes/unpublishes an object on an accessPointGUID in a given time period (or indefinitely).
You need to be logged in to use this feature.
The accessPointGUID must exists in the database in order to publish on it. As of 7th October 2013 you cannot create an accessPointGUID in the database via the API.
Parameters
- objectGUID the GUID of the object for which you want to set accessPointGUID
- accessPointGUID the accessPointGUID you want to publish on
- startDate (optional) the start of publishing period
- endDate (optional) the end of the publishing period
startDate and endDate should be in the format DD-MM-YYYY HH:MM:SS where the first MM is month and the seconds is minutes. e.g. 03-10-2013 14:25:42 is the 3rd of October 2013, twenty-five minutes and fourty-two seconds past 2 PM.
If no startDate is given the object will is unpublished, i.e. it will not be accessible from the given accessPoint. That is the following situations will unpublish the object:
Publishing | ||
---|---|---|
startDate | endDate | What happens |
not given | not given | Object is unpublished |
not given | given | Object is unpublished |
given | not given | Object is published indefinitely |
given | given | Object is published in given time period |
If startDate is given but no endDate is given the object will be published until you change the publish period or remove the accessPoint.
Returns
- On success: CHAOS.Portal.DTO.Standard.ScalarResult with value 1
- On error: a number of different errors can be given on erroneous dates, accessPointsGUID or objectsGUIDs. If the accessPoint does not exists you will get CHAOS.Portal.Exception.InsufficientPermissionsException
<PortalResult Duration="104">
<ModuleResults>
<ModuleResult Fullname="MCM" Duration="0" Count="1">
<Results>
<Result FullName="CHAOS.Portal.DTO.Standard.ScalarResult">
<Value>1</Value>
</Result>
</Results>
</ModuleResult>
</ModuleResults>
</PortalResult>
See also