Credio Client API

version 1.0

content

API Name Xml Request Xml Response Description
authenticate
<?xml version="1.0" encoding="UTF-8"?>
 <credio v="1.0">
  <authenticate domain="DOMAIN">
   <u>USERNAME</u>
   <p>PASSWORD</p>
  </authenticate>
 </credio>
<?xml version="1.0" encoding="UTF-8"?>
 <credio v="1.0">
  <res code="RESPONSE_CODE" msg="RESPONSE_MSG"/>
 </credio>
authenticate user credentials.
getToken
<?xml version="1.0" encoding="UTF-8"?>
 <credio v="1.0">
  <getToken domain="DOMAIN">
   <u>USERNAME</u>
   <p>PASSWORD</p>
  </getToken>
 </credio>
<?xml version="1.0" encoding="UTF-8"?>
<credio v="1.0">
 <token expire="UNIX_TIMESTAMP">
  TOKEN
 </token>
 <res code="RESPONSE_CODE" msg="RESPONSE_MSG"/>
</credio>
authenticate user credentials and return Token.
isValidToken
<?xml version="1.0" encoding="UTF-8"?>
 <credio v="1.0">
  <isValidToken domain="DOMAIN">
   <t>TOKEN</t>
  </isValidToken>
 </credio>
<?xml version="1.0" encoding="UTF-8"?>
 <credio v="1.0">
  <res code="RESPONSE_CODE" msg="RESPONSE_MSG"/>
 </credio>
check where Token is valid.
releaseToken
<?xml version="1.0" encoding="UTF-8"?>
 <credio v="1.0">
  <releaseToken domain="DOMAIN" token="TOKEN" />
 </credio>
<?xml version="1.0" encoding="UTF-8"?>
 <credio v="1.0">
  <res code="RESPONSE_CODE" msg="RESPONSE_MSG"/>
 </credio>
release Token.
API Name Xml Request Xml Response Description
getPermissions
<?xml version="1.0" encoding="UTF-8"?>
 <credio v="1.0">
  <getPermission
    domain="DOMAIN" 
    <[token="TOKEN"]|[user="USERNAME"]>
   >
   <path>PATH</path>
  </getPermission>
 </credio>
<?xml version="1.0" encoding="UTF-8"?>
 <credio v="1.0">
  <perms>
   <p p="PATH">PERMISSION</p>
   [<p p="PATH">PERMISSION</p>]
   ...
   [<p p="PATH">PERMISSION</p>]
  <perms>
  <res code="RESPONSE_CODE" msg="RESPONSE_MSG"/>
 </credio>
return Permission for requested PATH.
API Name Xml Request Xml Response Description
groupInsert
<?xml version="1.0" encoding="UTF-8"?>
 <credio v="1.0">
  <groupInsert domain="DOMAIN">
   <g name="GROUP_NAME">
    <memberof>
     <m idg="GROUP_ID" />
     [<m idg="GROUP_ID" />]
     [...]
     [<m idg="GROUP_ID" />]
    </memberof>
    <attributes>
     <a id="ATTRIBUTE_ID" type="ATTRIBUTE_TYPE" name="ATTRIBUTE_NAME" flags="ATTRIBUTE_FLAGS" len="ATTRIBUTE_VALUE_LENGTH">
      ATTRIBUTE_VALUE
     </a>
     [<a ... />]
     [...]
     [<a ... />]
    </attributes>
   </g>
  </groupInsert>
 </credio>
<?xml version="1.0" encoding="UTF-8"?>
 <credio v="1.0">
  <res code="RESPONSE_CODE" msg="RESPONSE_MSG"/>
 </credio>
create new Group.
groupEdit
<?xml version="1.0" encoding="UTF-8"?>
 <credio v="1.0">
  <groupEdit domain="DOMAIN">
   <g id="GROUP_ID" name="GROUP_NAME">
    <memberof>
     <m idg="GROUP_ID" />
     [<m idg="GROUP_ID" />]
     [...]
     [<m idg="GROUP_ID" />]
    </memberof>
    <attributes>
     <a id="ATTRIBUTE_ID" type="ATTRIBUTE_TYPE" name="ATTRIBUTE_NAME" flags="ATTRIBUTE_FLAGS" len="ATTRIBUTE_VALUE_LENGTH">
      ATTRIBUTE_VALUE
     </a>
     [<a ... />]
     [...]
     [<a ... />]
    </attributes>
   </g>
  </groupEdit>
 </credio>
<?xml version="1.0" encoding="UTF-8"?>
 <credio v="1.0">
  <res code="RESPONSE_CODE" msg="RESPONSE_MSG"/>
 </credio>
edit Group.
groupRemove
<?xml version="1.0" encoding="UTF-8"?>
 <credio v="1.0">
  <groupRemove domain="DOMAIN">
   <g id="GROUP_ID" />
  </groupRemove>
 </credio>
<?xml version="1.0" encoding="UTF-8"?>
 <credio v="1.0">
  <res code="RESPONSE_CODE" msg="RESPONSE_MSG"/>
 </credio>
remove Group.
API Name Xml Request Xml Response Description
userInsert
<?xml version="1.0" encoding="UTF-8"?>
 <credio v="1.0">
  <userInsert domain="DOMAIN">
   <u uname="USERNAME">
    [<p h="md5|sha256">USER_PASSWORD</p>]
    [<memberof>
     [<m idg="GROUP_ID | GROUP_NAME" />]
     [<m idg="GROUP_ID | GROUP_NAME" />]
     [...]
     [<m idg="GROUP_ID | GROUP_NAME" />]
    </memberof>]
   </u>
  </userInsert>
 </credio>
<?xml version="1.0" encoding="UTF-8"?>
 <credio v="1.0">
  <res code="RESPONSE_CODE" msg="RESPONSE_MSG"/>
 </credio>
create new User.
userEdit
<?xml version="1.0" encoding="UTF-8"?>
 <credio v="1.0">
  <userEdit domain="DOMAIN">
   <u id="USER_ID" uname="USERNAME">
    [<p h="md5|sha256">USER_PASSWORD</p>]
    [<memberof>
     [<m idg="GROUP_ID | GROUP_NAME" />]
     [<m idg="GROUP_ID | GROUP_NAME" />]
     [...]
     [<m idg="GROUP_ID | GROUP_NAME" />]
    </memberof>]
   </u>
  </userEdit>
 </credio>
<?xml version="1.0" encoding="UTF-8"?>
 <credio v="1.0">
  <res code="RESPONSE_CODE" msg="RESPONSE_MSG"/>
 </credio>
edit User.
userRemove
<?xml version="1.0" encoding="UTF-8"?>
 <credio v="1.0">
  <userRemove domain="DOMAIN">
   <u id="USER_ID" />
  </userRemove>
 </credio>
<?xml version="1.0" encoding="UTF-8"?>
 <credio v="1.0">
  <res code="RESPONSE_CODE" msg="RESPONSE_MSG"/>
 </credio>
remove User.
API Name Xml Request Xml Response Description
attrInsert
<?xml version="1.0" encoding="UTF-8"?>
 <credio v="1.0">
  <attrInsert domain="DOMAIN" targettype="TARGET_TYPE" target="TARGET_ID">
   <a name="ATTRIBUTE_NAME" type="ATTRIBUTE_TYPE" flags="ATTRIBUTE_FLAGS">
    ATTRIBUTE_VALUE
   </a>
  </attrInsert>
 </credio>
<?xml version="1.0" encoding="UTF-8"?>
 <credio v="1.0">
  <res code="RESPONSE_CODE" msg="RESPONSE_MSG"/>
 </credio>
create Attribute in object.
attrEdit
<?xml version="1.0" encoding="UTF-8"?>
 <credio v="1.0">
  <attrEdit domain="DOMAIN" targettype="TARGET_TYPE" target="TARGET_ID">
   <a id="ATTRIBUTE_ID" type="ATTRIBUTE_TYPE" name="ATTRIBUTE_NAME" flags="ATTRIBUTE_FLAGS">
    ATTRIBUTE_VALUE
   </a>
  </attrEdit>
 </credio>
<?xml version="1.0" encoding="UTF-8"?>
 <credio v="1.0">
  <res code="RESPONSE_CODE" msg="RESPONSE_MSG"/>
 </credio>
change Attribute object.
attrRemove
<?xml version="1.0" encoding="UTF-8"?>
 <credio v="1.0">
  <attrRemove domain="DOMAIN" targettype="TARGET_TYPE" target="TARGET_ID">
   <a < id="ATTRIBUTE_ID" | name="ATTRIBUTE_NAME" > />
  </attrRemove>
 </credio>
<?xml version="1.0" encoding="UTF-8"?>
 <credio v="1.0">
  <res code="RESPONSE_CODE" msg="RESPONSE_MSG"/>
 </credio>
remove Attribute from object.
getAttributes
<?xml version="1.0" encoding="UTF-8"?>
 <credio v="1.0">
  <getAttributes
    domain="DOMAIN" 
    [ [token="TOKEN"]|[user="USERNAME"] ]
   >
   <path>PATH</path>
  </getAttributes>
 </credio>
<?xml version="1.0" encoding="UTF-8"?>
 <credio v="1.0">
  <attrs>
   <a k="ATTR_NAME" t="ATTR_TYPE">ATTR_VALUE</a>
   [<a k="ATTR_NAME" t="ATTR_TYPE">ATTR_VALUE</a>]
   [...]
   [<a k="ATTR_NAME" t="ATTR_TYPE">ATTR_VALUE</a>]
  </attrs>
  <res code="RESPONSE_CODE" msg="RESPONSE_MSG"/>
 </credio>
get Attribute for rerquested PATH.
TERMDESCRIPTION
DOMAIN

type string

name of the domain witch will serve given request.

PATH

type string

string represents the path for Domain,User or Resource from Credio concept.

USERNAME

type string

USERNAME for user account, must be unique for every user account within DOMAIN.

PASSWORD

type string

PASSWORD for user account.

RESPONSE_CODE

type unsigned integer

see also: response codes list

RESPONSE_MSG

type string

short informational message returned together with RESPONSE_CODE

UNIX_TIMESTAMP

type unsigned 32bit integer

the time since the Epoch (00:00:00 UTC, January 1, 1970), measured in seconds.

TOKEN

type string

string in format ^[0-9ABCDEF-]+$ generated from Credio in result of getToken() API.

PERMISSION

type unsigned 32bit integer

permission value is logical OR of all set (granted) permissions.

corespondenting bits permissions in big endian (most significant first)

  • READ - 1 bit
  • WRITE - 2 bit
  • EXEC - 3 bit
ATTRIBUTE_ID

type unsigned 64bit integer

Unique ID for given attribute.

ATTRIBUTE_NAME

type string

name for given attribute.

ATTRIBUTE_TYPE

type string

Specifies type of attribute value.

Available types:

STRING,BOOLEAN,BYTES,NUMBER,DECIMAL

ATTRIBUTE_VALUE

type string

Attribute value.

  • STRING, NUMBER, DECIMAL - utf-8 text.
  • BOOLEAN - '0' - false, NOT '0' - true.
  • BYTES - base 64 encoded bytes.
ATTRIBUTE_VALUE_LENGTH

type unsigned 32bit integer

length of ATTRIBUTE_VALUE in bytes.

GROUP_ID

type unsigned 64bit integer

Unique ID for a given group.

GROUP_NAME

type string

Unique Name for a given group.

USER_ID

type unsigned 64bit integer

Uniq ID for given user.

TARGET_TYPE

type unsigned 8bit integer

target type defines type of object specified in TERM-TARGET

  • DOMAIN - 0x00
  • RESOURCE - 0x01
  • GROUP - 0x03
  • USER - 0x04
  • NETCLIENT - 0x05
TARGET_ID

type unsigned 64bit integer

Unique ID for given target.