PlanningPME API - Developer documentation

PlanningPME provides you with a dedicated API, bringing read and write access to each data in your PlanningPME database.

In this document you will learn:

PlanningPME API is based on RESTful principles, and the default data transfer format is JSON.
This documentation is mainly for developers. We recommend the reader to familiarize with JSON REST API programming before going further.

Dedicated URL

Each PlanningPME client has its own dedicated API address.
Say your brand name is "MyCompany", you should probably use the brand key "mycompany" (ignoring case) in order to build your API address.
This key will be noted as "your_brand" in the rest of this documentation.

The base API address of a brand will always be :
https://api.planningpme.com/your_brand/

Interactive documentation

Each brand API also presents an interactive documentation, very useful to discover your PlanningPME API methods and models and build API calls.
This documentation is available at the following address :
https://api.planningpme.com/your_brand/doc/index

Security

1/ Application key presentation

You need an application key (appkey) in order to access your API, thus identifying the caller application.
This appkey is available in your PlanningPME account or on demand to our support.
In addition to securing API access, the appkey let you grant access to a partner or a tier-application, by bringing them their own key to identify their calls to the API.

The appkey should always be passed in the headers of an API call, by using dedicated "X-APPKEY" header.

GET /your_brand/api/config HTTP/1.1
Host: api.planningpme.com
X-APPKEY: e991573da5ffd4sab9b1e26bc6b64aac

2/ User token and impersonation

Most of the API calls should be user-authenticated, in order to use impersonation during the data access and respect defined user and group authorizations.

An authorization is granted by submitting user's name and password to the API, then getting a token that will be used to authenticate or impersonate any subsequent API call.

Getting an authorization token is always done by posting these data to the "/token" url.

POST /your_brand/token HTTP/1.1
Host: api.planningpme.com
X-APPKEY: e991573da5ffd4sab9b1e26bc6b64aac

grant_type=password&username=your_username&password=your_password

In case of a successfull authentication, response's body should contain some JSON like the following.

{
    "access_token": "KTuZYDLG2qjUMqMVXDuiP9giFbqDXstESvpUWzBFLpkfdlMiB3PD5s2K7En-3o39u56hpr_DlyjEc_oUzBbR0PoEQfOb_O7m5BrLz9vwDzV_YjtRRrQ_7QxYnxO9uZs38SJ7UxTjDZgx_JKRUoZ3Wk6RNnXRpSkcmOrINvJLDMYXptYFiTjn9Op-vkPdtOKFp9M1cNjrH1ho2uaRBpUUMH_vJ-8W8mTH9wgFrJlecGIpntb7jet2GYpGs3Is0gcH",
    "token_type": "bearer",
    "expires_in": 86399,
    "username": "your_username"
}

Value of the "access_token" property should then be used in subsequent authorized requests to the API.
And as indicated by the "token_type" property, this value is a bearer token.

Any subsequent authorized call should then present the "Authorization" header with this specific "Bearer" value.

POST /your_brand/api/customer HTTP/1.1
Host: api.planningpme.com
X-APPKEY: e991573da5ffd4sab9b1e26bc6b64aac
Authorization: Bearer KTuZYDLG2qjUMqMVXDuiP9giFbqDXstESvpUWzBFLpkfdlMiB3PD5s2K7En-3o39u56hpr_DlyjEc_oUzBbR0PoEQfOb_O7m5BrLz9vwDzV_YjtRRrQ_7QxYnxO9uZs38SJ7UxTjDZgx_JKRUoZ3Wk6RNnXRpSkcmOrINvJLDMYXptYFiTjn9Op-vkPdtOKFp9M1cNjrH1ho2uaRBpUUMH_vJ-8W8mTH9wgFrJlecGIpntb7jet2GYpGs3Is0gcH

API usage

1/ Common data considerations

a) Models

PlanningPME data models can be easily discovered by using the interactive documentation of your API.

b) Date format

Date format used by the API and expected in each JSON request is ISO 8601 format. Ex:

2018-01-25T18:05:00Z

c) Sorting lists

GET methods often use a "sortInfo" parameter to set the sorting order of the full/paginated list returned.

This info is composed with the name of a property directly followed by a + or - sign.
For instance use "label+" in order to sort by ascending "label" property.

It is also possible to combine multiple orders by appending them.
For instance use "notValid-label+" to sort by descending "notValid" property then by ascending "label" property.

Be aware that property labels are case sensitive.

d) Constant enumerations

Complete list of enums in use with your API version is obtained by calling the "/api/config" method.

GET /your_brand/api/config HTTP/1.1
Host: api.planningpme.com
X-APPKEY: e991573da5ffd4sab9b1e26bc6b64aac

Below the list enums for version 4.1.1.116 of the API.

{
  ...
  enums: {
	"BillingType": {
	  "Package": 0,
	  "Unit": 1
	},
	"JsonWritingType": {
	  "Normal": 1,
	  "KeyLabel": 2,
	  "String": 3
	},
	"LicenseStatus": {
	  "Other": 0,
	  "Evaluation": 1,
	  "Ok": 2,
	  "NoExpirationDate": -8,
	  "WrongDatabase": -7,
	  "WrongMachine": -6,
	  "ResourceCount": -5,
	  "LicenseCount": -4,
	  "Expired": -3,
	  "Empty": -2,
	  "Corrupted": -1
	},
	"HistoryOp": {
	  "Insert": 65,
	  "Delete": 68,
	  "Email": 69,
	  "Invitation": 73,
	  "Update": 85
	},
	"HistoryType": {
	  "Customer": 67,
	  "Unavailability": 73,
	  "Project": 80,
	  "Resource": 82,
	  "Task": 84
	},
	"NotificationType": {
	  "None": 0,
	  "TaskInsert": 1,
	  "TaskUpdate": 2,
	  "UnavailabilityInsert": 4,
	  "UnavailabilityUpdate": 8
	},
	"PpAccess": {
	  "All": 0,
	  "Read": 82,
	  "Write": 87
	},
	"PpConstraintAction": {
	  "PpActionNoTaskBeforeNbHours": 0,
	  "PpActionNoTaskBeforeNbDays": 1,
	  "PpActionNoTaskSamePeriod": 2,
	  "PpActionNbMaxHours": 3,
	  "PpActionNbMax": 4,
	  "PpActionDurationMaxHours": 5,
	  "PpActionDurationMaxDays": 6
	},
	"PpConstraintFor": {
	  "PpForAll": 0,
	  "PpForResources": 1,
	  "PpForDepartments": 2
	},
	"PpConstraintIf": {
	  "PpIfNothing": 0,
	  "PpIfNb": 1,
	  "PpIfNbHours": 2,
	  "PpIfBegin": 3,
	  "PpIfEnd": 4
	},
	"PpConstraintOp": {
	  "PpOpNothing": 0,
	  "PpOpEqual": 1,
	  "PpOpInf": 2,
	  "PpIfInfEqual": 3,
	  "PpIfSup": 4,
	  "PpIfSupEqual": 5,
	  "PpIfBefore": 6,
	  "PpIfAfter": 7
	},
	"PpConstraintType": {
	  "PpConstraintTypeTask": 0,
	  "PpConstraintTypeUnavailability": 1
	},
	"PpConstraintWhat": {
	  "PpLabelAll": 0,
	  "PpLabelExact": 1,
	  "PpLabelBegin": 2
	},
	"PpConstraintWhen": {
	  "PpWhenNothing": 0,
	  "PpWhenDay": 1,
	  "PpWhenWeek": 2,
	  "PpWhenMonth": 3,
	  "PpWhenYear": 4
	},
	"PpCustomerType": {
	  "PpCustomerIndividual": 1026,
	  "PpCustomerCompany": 1027
	},
	"PpDescriptionFieldType": {
	  "PpDescriptionFieldTypeIndex1": 49,
	  "PpDescriptionFieldTypeIndex2": 50,
	  "PpDescriptionFieldTypeEmailBody": 69,
	  "PpDescriptionFieldTypeLabel": 76,
	  "PpDescriptionFieldTypeMobile": 77,
	  "PpDescriptionFieldTypeCalendrier": 79,
	  "PpDescriptionFieldTypeEmailSubject": 83,
	  "PpDescriptionFieldTypeTooltip": 84
	},
	"PpDestination": {
	  "PpTask0": 48,
	  "PpTask2": 50,
	  "PpTask3": 51,
	  "PpTask4": 52,
	  "PpTask5": 53,
	  "PpEquipment0": 65,
	  "PpCustomer1": 67,
	  "PpRM1": 77,
	  "PpRM2": 78,
	  "PpRM3": 79,
	  "PpProject0": 80,
	  "PpRH1": 82,
	  "PpRH2": 83,
	  "PpTask1": 84,
	  "PpRH3": 86,
	  "PpCustomer0": 97,
	  "PpRH0": 98,
	  "PpCustomer2": 99,
	  "PpRM0": 100
	},
	"PpDestinationType": {
	  "PpTask": 0,
	  "PpCustomer": 1,
	  "PpEquipment": 2,
	  "PpResource": 3,
	  "PpProject": 4
	},
	"PpFilter": {
	  "PpAll": 40960,
	  "PpHuman": 45056,
	  "PpMaterial": 49152,
	  "PpToPlan": 53248
	},
	"PpOneOrMoreCustomers": {
	  "OneCustomer": 1422,
	  "MoreCustomer": 1423
	},
	"PpOneOrMoreResources": {
	  "OneResource": 1076,
	  "MoreResource": 1077
	},
	"PpRecurrenceDaily": {
	  "PpAllThe": 1255,
	  "PpAllWorkingDays": 1256
	},
	"PpRecurrenceMonthly": {
	  "PpDate": 1258,
	  "PpDay": 1259
	},
	"PpRecurrenceRange": {
	  "PpNoEndDate": 1250,
	  "PpEndThe": 1252
	},
	"PpRecurrenceType": {
	  "PpDaily": 1246,
	  "PpWeekly": 1247,
	  "PpMonthly": 1248,
	  "PpYearly": 1249
	},
	"PpResourceType": {
	  "PpResourceHuman": 1035,
	  "PpResourceMaterial": 1036,
	  "PpResourceToPlan": 1537
	},
	"PpTaskType": {
	  "PpTaskDefault": 1467,
	  "PpTaskTime": 1468,
	  "PpTaskPeriod": 1469
	},
	"PpTitle": {
	  "Miss": 0,
	  "Mr": 1,
	  "Ms": 2
	},
	"PpTypeDataField": {
	  "PpDate": 1,
	  "PpTime": 2,
	  "PpText": 3,
	  "PpNumeric": 4,
	  "PpDouble": 5,
	  "PpCombo": 6,
	  "PpLink": 7,
	  "PpCheck": 8,
	  "PpMemo": 9,
	  "PpSeparator": 10,
	  "PpFile": 11,
	  "PpPosition": 12,
	  "PpSignature": 13,
	  "PpHyperlink": 16,
	  "PpStartdate": 17,
	  "PpEnddate": 18,
	  "PpDuration": 19
	},
	"PpTypeHatch": {
	  "PPHS_BDIAGONAL": 0,
	  "PPHS_CROSS": 1,
	  "PPHS_DIAGCROSS": 2,
	  "PPHS_FDIAGONAL": 3,
	  "PPHS_HORIZONTAL": 4,
	  "PPHS_VERTICAL": 5
	},
	"PpWorkCapacity": {
	  "PpHours": 1590,
	  "PpSlots": 1591
	},
	"RecurrenceMonthlyDayWhich": {
	  "First": 0,
	  "Second": 1,
	  "Third": 2,
	  "Fourth": 3,
	  "Last": 4
	},
	"TimeLapseUnit": {
	  "Day": 0,
	  "Week": 1,
	  "Month": 2,
	  "Year": 3
	}
  }
  ...

e) Response language

The language used in response texts such as error messages can be specified with the "Accept-Language" header.

Accept-Language: en

The languages available in PlanningPME API and PlanningPME WebAccess are: danish (da), dutch (nl), english (en), finnish (fi), french (fr), german (de), italian (it), norwegian (no), polish (pl), russian (ru), spanish (es), swedish (sv).

2/ Examples of API calls

In the examples below the application key will be noted as "your_key" and the bearer token as "your_token". Please replace them with your own values.

/api/task

→ Get a full or paginated list of tasks with GET "/api/task" method.

GET /your_brand/api/task?pageIndex=1&pageSize=20&sortInfo=label- HTTP/1.1
Host: api.planningpme.com
X-APPKEY: your_key
Authorization: your_token

Returns an array of tasks containing second page of 20 tasks ordered by descending label.

{
  "totalItems": 97,
  "items": [
    {
      "key": 756,
      "label": "English course for children",
      "type": 1467,
      "style": {
        "backgroundColor": "#65A18D",
        "color": "#000000"
      }
    },
	...
    {
      "key": 131,
      "label": "Consultancy",
      "type": 1467,
      "style": {
        "backgroundColor": "#214DE9",
        "color": "#000000"
      }
    }
  ]
}

→ Get a detailed task with GET "/api/task/{id}" method.

GET /your_brand/api/task/756 HTTP/1.1
Host: api.planningpme.com
X-APPKEY: your_key
Authorization: your_token

Returns a detailed task object representation of the task with id 756.

{
  "key": 756,
  "label": "English course for children",
  "type": 1467,
  "style": {
    "backgroundColor": "#65A18D",
    "color": "#000000"
  },
  "skills": [
    [
      {
        "key": 12,
        "name": "Teaching",
        "label": "Teaching > Children",
        "level": 1,
        "domain": {
          "key": 4,
          "label": "Children"
        }
      },
      {
        "key": 83,
        "name": "English",
        "label": "Languages > English",
        "level": 1,
        "domain": {
          "key": 4,
          "label": "Languages"
        }
      }
    ]
  ]
}

/api/do

Coming soon...

/api/resource

Coming soon...

/api/project

Coming soon...

/api/file

Coming soon...

See also: