Authentication

The API key for the connecting user can be provided in one of the following ways:

  • As password of the Basic HTTP Authorization header of the request (with empty username).

  • As content of the user element (child of the root element) of the XML in the request. (Unless it concerns a GET request)


GET /api/v1/organisations.xml
Returns a list of all organisations

Example request to server

curl -X GET https://xmlagri.qcone.com/api/v1/organisations.xml --user :api_key

Example response from server

<?xml version="1.0" encoding="UTF-8"?>
<organisations>
  <organisation>
    <id>1</id>
    <customerId>ABC123</customerId>
    <name>Name of the company</name>
    <countryCode>GB</countryCode>
    <isActive>false</isActive>
  </organisation>
</organisations>

GET /api/v1/organisations/:id.xml
Retrieves a single organisation

Example request to server

curl -X GET https://xmlagri.qcone.com/api/v1/organisations/1.xml --user :api_key

Example response from server

<?xml version="1.0" encoding="UTF-8"?>
<organisation>
  <id>1</id>
  <customerId>ABC123</customerId>
  <name>Name of the company</name>
  <countryCode>GB</countryCode>
  <isActive>false</isActive>
</organisation>

POST /api/v1/organisations.xml
Creates an organisation

Example request to server

curl -X POST https://xmlagri.qcone.com/api/v1/organisations.xml \
  --user :api_key \
  --data '<?xml version="1.0" encoding="UTF-8"?>
<organisation>
  <customerId>ABC123</customerId>
  <name>Name of the company</name>
  <countryCode>GB</countryCode>
  <isActive>false</isActive>
</organisation>'

Example response from server

<?xml version="1.0" encoding="UTF-8"?>
<organisation>
  <id>19167</id>
  <customerId>ABC123</customerId>
  <name>Name of the company</name>
  <countryCode>GB</countryCode>
  <isActive>false</isActive>
</organisation>

Params

Param name Description
code
optional

Customer Code

Validations:

  • Must be String

name
required

Name of the organisation

Validations:

  • Must be String

countryCode
optional

Code of the organisation's country - ISO 3166/alpha2

Validations:

  • Must be String

isActive
optional

True when organisation has to have access to QCOne. False when no access is needed

Validations:

  • Must be 'true' or 'false' or '1' or '0'

email
optional

Email of the admin account of the organisation. Required when isActive is True

Validations:

  • Must be String

notificationEmailCode
optional

Single notification mail code

Validations:

  • Must be String


PATCH /api/v1/organisation/:id.xml
Modifies an organisation

Example request to server

curl -X PATCH https://xmlagri.qcone.com/api/v1/organisations/19167.xml \
  --user :api_key \
  --data '<?xml version="1.0" encoding="UTF-8"?>
<organisation>
  <customerId>ABC123</customerId>
  <name>Name of the company</name>
  <countryCode>GB</countryCode>
  <isActive>false</isActive>
</organisation>'

Example response from server

<?xml version="1.0" encoding="UTF-8"?>
<organisation>
  <id>19167</id>
  <customerId>ABC123</customerId>
  <name>Name of the company</name>
  <countryCode>GB</countryCode>
  <isActive>false</isActive>
</organisation>

Params

Param name Description
code
optional

Customer Code

Validations:

  • Must be String

name
required

Name of the organisation

Validations:

  • Must be String

countryCode
optional

Code of the organisation's country - ISO 3166/alpha2

Validations:

  • Must be String

isActive
optional

True when organisation has to have access to QCOne. False when no access is needed

Validations:

  • Must be 'true' or 'false' or '1' or '0'

email
optional

Email of the admin account of the organisation. Required when isActive is True

Validations:

  • Must be String

notificationEmailCode
optional

Single notification mail code

Validations:

  • Must be String