Getting Started
Momentum Fastighet API is a public web API which aggregates and deliveres information from several backend systems, for example Momentum PM, Momentum Login and Momentum Files.
HTTP Headers
The API requires HTTP headers to be set. Please review Inledning for a list of optional and required headers (currently only available in Swedish) for information about how to call the API and how to handle errors correctly.
Header | Description |
---|---|
Accept-Language | Language selected by end-user in webbrowser or app. See RFC-2616 and MDN for more information. Example: sv,en-US;q=0.9,en;q=0.8 or sv-SE . Culture sv-SE and en-GB is supported by the API by default. This header is optional. |
X-Client-Version | Required Version number of the calling client application. Currently used only for logging and troubleshooting. |
Example
Acquire an Access Token
In order to use the API, you typically need to login as a user. Use the Auth-endpoints to sign-in.
Explore the API
Please see the Endpoint Index for a list of available API:s.
Guids
The term Guid
in the Momentum API is an universally unique identifier with contraints detailed below.
The constraints exist mainly due to legacy reasons, we are moving from using two types of identifiers (long + guid) toward only using one type, guid, and therefore must currently differentiate between a number (old id) and guid.
A Guid
is required to meet the following conditions when used with the Momentum API:
- Must be globally unique.
- Must be minimum 21 characters in length
- Must not exceed 64 characters in length
- Must currently only contain the following characters:
[a..z][A..Z][0..9][-]
(may change in the future). - Must currently contain at least one character
[a..z][A..Z]
(it must not contain only numbers)
Example (valid):
* 123e4567-e89b-12d3-a456-426614174000
* 1AraGbc45z465a46afaGe
* u1mzr-66p635hjha4a6gjkafaa
Example of invalid identifiers:
* 1234564879789789798789798
(only numbers)
* -545
(only numbers)
* 1234a
(too short)
Input validation
The API validates input but in order to improve the user experience, some validation is typically also applied immediately on the client. Validation described here is using regex (regular expression).
Mobile Phone Numbers
- Mobile number regex
^\+?(([0-9]+)([\-\. ]?))*([0-9]+)$
Very simple controll. Basically, any number - Number must have at least one digit.
- Can start with an optional
+
sign followed by a mandatory digit. - Number can have any combination digits between 0-9.
- Number can only have one consecutive appearance of the characters
-.[space]
. -
Number must end with a digit.i.e
0-9
. -
Examples of valid mobile numbers:
- +46 70 456 23 00
- 46 70.45 6-23-00
- 19059031899
- 023-704526
-
Invalid numbers:
- -070 45 45 45
- 070--45 45 45
- 070 45 45 45-
E-mail Addresses
- Email regex
[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?
This regex is more complicated but basically allows any email address. Email validation as per RFC2822. - Before the domain name any charater and the last character befor the domain name must be an
@
sign. -
After the last
@
the adress can only have english character and number a-z and 0-9. -
Examples of a valid email addresses:
- เกิน.Östermalme@gmail.se (Thai)
- 干杯.Östermalme@gmail.se (Chineese)
- hello@momentum.se (English)
- Über.Jænsen@momentum.se (German/Danish/English)