Yes-co Open API
- The API is a RESTfull service
- The API supports both JSON and XML output formats. Use the ?format=xml or ?format=json to change output format. The default output format is JSON.
API Objects
- Most objects (projects, relations, notes, images etc.) are available through the Yes-co Open API.
- Use HTTP/1.1 GET request to retrieve objects
- Use HTTP/1.1 POST request to add/modify objects
- Use HTTP/1.1 DELETE request to remove objects
- All objects in Yes-co Open have a unique id, the API Object ID.
- There is one special API Object ID, called ‘session’. This object refers to a Yes-co Open browser session, which does the same thing as logging in at https://login.yes-co.com with a web browser.
- All requests follow a standard URL scheme
- https://api.yes-co.com/1.0/ or
- https://api.yes-co.com/1.0/:apiObjectId/
Project
ProjectCreate
- Creates a new project entity
- This is a HTTP/1.1 POST request
- Url: https://api.yes-co.com/1.0/:apiObjectId/project
- apiObjectId is the API id of the parent project, linked office of linked employee
Arguments
- client_id (required)
- Client id provided by Yes-co
- user_id (required)
- User id provider by Yes-co, this is an API object id
- signature (required)
- SHA1 encrypted version of client_id, signed with the client secret
- ie.: HMAC(client_id, client_secret) ; SHA1
- scenario (required)
- Scenario of project (BBvk, BBvh, NBvk, etc…)
- type (required for BBvk, BBvh, NBvk, NBty, BOvk and BOvh)
- Type of project (Woonruimte, etc…)
- See project for possible scenario/type/subtype combinations
- subtype (required for BBvk, BBvh, NBvk, NBty, BOvk and BOvh)
- Sub type of project (Woonhuis, Appartement, etc…)
- See project for possible scenario/type/subtype combinations
- name (required)
- Display name of the project (Rondinweg 63)
- country (required when rest of address is set)
- Country from project address
- city (required when rest of address is set, except for NBpr)
- City from project address
- street (required when rest of address is set, except for NBpr)
- Street from project address
- zipcode (required when rest of address is set, except for NBpr)
- Zipcode from project address
- housenumber (required when rest of address is set, except for NBpr)
- House number from project address
- housenumber_addition
- House number addition from project address
Response
API object id of the created of project, this can be used to display the project with the navigate call
integer(5) "84325"
ProjectList
- Retrieves a list of projects
- This is a HTTP/1.1 GET request
- Url: https://api.yes-co.com/1.0/:apiObjectId/project
- apiObjectId is the API id of the parent project, linked office of linked employee
Arguments
- client_id (required)
- Client id provided by Yes-co
- user_id (required)
- User id provider by Yes-co, this is an API object id
- signature (required)
- SHA1 encrypted version of client_id, signed with the client secret
- ie.: HMAC(client_id, client_secret) ; SHA1
Response
List containing project id’s (API Object ID’s)
array(16) {
[0]=>
array(1) {
["project"]=>
array(1) {
["id"]=>
string(10) "1260556652"
}
}
[1]=>
array(1) {
["project"]=>
array(1) {
["id"]=>
string(10) "1934818301"
}
}
ProjectRetrieve
- Retrieves the XML content of a single project object
- This is a HTTP/1.1 GET request
- Url: https://api.yes-co.com/1.0/
Arguments
- client_id (required)
- Client id provided by Yes-co
- user_id (required)
- User id provider by Yes-co, this is an API object id
- signature (required)
- SHA1 encrypted version of client_id, signed with the client secret
- ie.: HMAC(client_id, client_secret) ; SHA1
Response
Project XML content (JSON output format is not possible).
<?xml version="1.0" encoding="UTF-8"?> <Project xmlns="http://service.yes-co.nl/apixml/project10" timestampGenerated="2011-01-28T11:20:42+01:00" modifiedDate="2011-01-27T13:06:25+01:00" createdDate="2009-05-25T00:00:00+02:00" id="1766845205"> <Scenario>BBvk</Scenario> <Type>Woonruimte</Type> <SubType>Woonhuis</SubType> <Archived>false</Archived> <Name>Capricciostraat 47 (voorbeeld woning verkoop)</Name> <YProjectNumber>1</YProjectNumber> <Status> <Description>verkocht onder voorbehoud</Description> </Status> <BBvk> <General> <Name>Capricciostraat 47</Name> <ObjectStatus>verkocht onder voorbehoud</ObjectStatus> <Voorbehoud>2010-10-31</Voorbehoud> .... </Project>
Session
- Url: https://api.yes-co.com/1.0/session
SessionOpen
- Open a Yes-co Open session displaying a project or relation
- This method is HTTP/1.1 POST
Arguments
- client_id (required)
- Client id provided by Yes-co
- user_id (required)
- User id provider by Yes-co, this is an API object id
- signature (required)
- SHA1 encrypted version of client_id, signed with the client secret
- ie.: HMAC(client_id, client_secret) ; SHA1
Response
- session
- Session key and application server
object(YisApiSession)#4 (2) {
["sessionKey:protected"]=>
string(32) "ef3fdcec8f170cce9dddef569cbe224b"
["applicationServer:protected"]=>
string(42) "https://app-s03-rb2e.yes-co.com/"
}
Note: Once a session is open, redirect the browser to ‘application server/sessionKey’ (e.g.: https://app-s03-rb2e.yes-co.com/ef3fdcec8f170cce9dddef569cbe224b) or set a cookie using the Javascript library.
SessionClose
- Invalidate session key acquired by SessionOpen
- This is a HTTP/1.1 DELETE request
Arguments
- client_id (required)
- Client id provided by Yes-co
- user_id (required)
- User id provider by Yes-co, this is an API object id
- signature (required)
- SHA1 encrypted version of client_id, signed with the client secret
- ie.: HMAC(client_id, client_secret) ; SHA1
Response
String containing ‘closed’ status:
string(6) "closed"
SessionPing
- Check if acquired session is still valid
- This method is a HTTP/1.1 GET request
- Url: https://api.yes-co.com/1.0/session
Arguments
- client_id (required)
- Client id provided by Yes-co
- user_id (required)
- User id provider by Yes-co, this is an API object id
- signature (required)
- SHA1 encrypted version of client_id, signed with the client secret
- ie.: HMAC(client_id, client_secret) ; SHA1
Response
If a valid session is available, a status ‘valid’ is returned
string(5) "valid"
SessionUrl
- Navigate to a page in Yes-co Open
- This is a HTTP/1.1 GET request
- Url: https://api.yes-co.com/1.0/session/url
Arguments
- client_id (required)
- Client id provided by Yes-co
- user_id (required)
- User id provider by Yes-co, this is an API object id
- signature (required)
- SHA1 encrypted version of client_id, signed with the client secret
- ie.: HMAC(client_id, client_secret) ; SHA1
- api_object_id (required)
- Opens project/relation page
- location (required)
- Yes-co Open page name (currently, the only supported page name is ‘dashboard’)
Response
Url to the location/page of the API object to display
string(42) "https://app-s03-rb2e.yes-co.com/project/3"