This API contains the basic CRUD operations for the CONNECT users. In addition it allows you to do stuff like resetting password and sending of activation emails. The user may be in a few important states. A user is active when he has created a password. This usually entails that he has either a verified email or phone.

Users 

User collection resource 

  • pinAuthenticationAllowed: Is the user allowed to authenticate via PIN (user needs to be active, and within expiration time)

  • authenticateExpiry: When does the users authentication expire.

  • attributes: A map containing key/values for the user.

  • birthdate: The users birth date.

  • active: Is the user active or not.

  • username_verified: Is the user verified.

  • username: The user’s username.

  • rights_href: A link to the users rights.

  • link: A list of links to the users subresources: self, accounts, mails, phones, rights, subs, tnc and attributes.

  • generation: The generation counter. This field changes whenever the right is updated. This field can be used for optimistic concurrency control.

  • href: This is a reference to the resource itself.

  • id: The CONNECT ID for the user owning the right.

{
    "pinAuthenticationAllowed": true,
    "authenticationExpiry": 0,
    "attributes": {
        "user-locale": "no"
    },
    "birthdate": null,
    "realname": null,
    "active": false,
    "username_verified": false,
    "username": "4740000000",
    "rights_href": "https://api.telenor.io/id/users/<connectId>/rights",
    "link": [
        {
            "idref": null,
            "type": null,
            "href": "https://api.telenor.io/id/users/<connectId>",
            "rel": "self"
        },
        {
            "idref": null,
            "type": null,
            "href": "https://api.telenor.io/id/users/<connectId>/accounts",
            "rel": "accounts"
        },
        {
            "idref": null,
            "type": null,
            "href": "https://api.telenor.io/id/users/<connectId>/mails",
            "rel": "mails"
        },
        {
            "idref": null,
            "type": null,
            "href": "https://api.telenor.io/id/users/<connectId>/phones",
            "rel": "phones"
        },
        {
            "idref": null,
            "type": null,
            "href": "https://api.telenor.io/id/users/<connectId>/rights",
            "rel": "rights"
        },
        {
            "idref": null,
            "type": null,
            "href": "https://api.telenor.io/id/users/<connectId>/subs",
            "rel": "subs"
        },
        {
            "idref": null,
            "type": null,
            "href": "https://api.telenor.io/id/users/<connectId>/tnc",
            "rel": "tnc"
        },
        {
            "idref": null,
            "type": null,
            "href": "https://api.telenor.io/id/users/<connectId>/attributes",
            "rel": "attributes"
        }
    ],
    "generation": "597380595426788121",
    "href": "https://api.telenor.io/id/users/<connectId>",
    "id": "<connectId>"
}
Get user by username
/id/users{?username}

Retrieves a user object based on either email or phone.

Example URLs:
    - https://api.telenor.io/id/users\?username\=<phone_number>
    - https://api.telenor.io/id/users\?username\=<email>
  • Parameters
  • username
    string (required) 

    The username to look for.

  • Request
  • Headers
    Accept: application/json
    Authorization: Basic <Base64 encoding of username:password>
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
      "id": "5950900328395186176",
      "href": "https://api.telenor.io/id/users/5950900328395186176",
      "generation": 6041542547891835000,
      "link": [
        {
          "rel": "self",
          "href": "https://api.telenor.io/id/users/5950900328395186176",
          "type": null,
          "idref": null
        },
        {
          "rel": "accounts",
          "href": "https://api.telenor.io/id/users/5950900328395186176/accounts",
          "type": null,
          "idref": null
        },
        {
          "rel": "mails",
          "href": "https://api.telenor.io/id/users/5950900328395186176/mails",
          "type": null,
          "idref": null
        },
        {
          "rel": "phones",
          "href": "https://api.telenor.io/id/users/5950900328395186176/phones",
          "type": null,
          "idref": null
        },
        {
          "rel": "rights",
          "href": "https://api.telenor.io/id/users/5950900328395186176/rights",
          "type": null,
          "idref": null
        },
        {
          "rel": "subs",
          "href": "https://api.telenor.io/id/users/5950900328395186176/subs",
          "type": null,
          "idref": null
        },
        {
          "rel": "tnc",
          "href": "https://api.telenor.io/id/users/5950900328395186176/tnc",
          "type": null,
          "idref": null
        },
        {
          "rel": "attributes",
          "href": "https://api.telenor.io/id/users/5950900328395186176/attributes",
          "type": null,
          "idref": null
        }
      ],
      "rights_href": "https://api.telenor.io/id/users/5950900328395186176/rights",
      "username": "xxxxxx@yyyyyy.com",
      "username_verified": true,
      "active": true,
      "realname": "J R Customer",
      "birthdate": null,
      "businessunit": "TICS",
      "attributes": {
        "user-locale": "en"
      },
      "authenticationExpiry": 0,
      "pinAuthenticationAllowed": false
    }
  • Response  401
  • Headers
    Content-Type: text/html
    WWW-Authenticate: Basic realm="Sylfide API"
  • Response  404
  • Headers
    Content-Type: text/html
Create user
/id/users{?username}

Creates a CONNECT User.

Request body parameters:

  • password (string, optional) - The password for the user.

  • email (string, optional/required) - The users email.

  • phone (string, optional/required) - The users phone number.

  • realname (string, optional) - The users real name.

  • birthdate (string, optional) - The users birth date.

  • businessunit (string, optional) - A users business unit.

  • locale (string, optional) - locale of the user. Locale values are listed at supported languages

Either phone or email is required.

  • Request
  • Headers
    Content-Type: application/json
    Accept: application/json
    Authorization: Basic <Base64 encoding of username:password>
    Body
    <user object>
    
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    <user response object>
    
  • Response  500
  • Body
    - Could not create user
    
  • Response  401
  • Headers
    Content-Type: text/html
    WWW-Authenticate: Basic realm="Sylfide API"
  • Response  409
  • Body
    - username already registered
    
  • Response  400
  • Body
    - No user specified
    - username not provided
    - Birth date syntax error:  <input.birthdate>
    - Invalid email address
    - Invalid phone number
    - Neither email nor phone is set, or they are invalid.
    

User resource 

Get user by id
/id/users/{connectId}

Gets a user by its CONNECT ID.

Supports both Bearer and Basic authentication schemes. Requires OAuth scope value “id.user.read” when using Bearer scheme. If Bearer scheme is used, the CONNECT ID in the path may be replaced with the static string “me”, that is, the path “/id/users/me” may be used instead.

  • Parameters
  • connectId
    string (required) 

    The CONNECT ID.

  • Request
  • Headers
    Accept: application/json
    Authorization: Bearer <access token>
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    <user response object>
    
  • Response  401
  • Headers
    Content-Type: text/html
    WWW-Authenticate: Bearer realm="telenordigital", error="invalid_token", errorDescription="The access token is expired, revoked, malformed or otherwise invalid"
  • Response  404
  • Headers
    Content-Type: text/html
Delete user
/id/users/{connectId}

Deletes a user. To delete a user, it needs to be done prior to adding any accounts or activating the user. Once a user reaches this state, it can no longer be deleted.

  • Parameters
  • connectId
    string (required) 

    The CONNECT ID.

  • Request
  • Headers
    Accept: application/json
    Authorization: Basic <Base64 encoding of username:password>
  • Response  204
  • The user is no more. It has ceased to be.

    Headers
    Content-Type: application/json
  • Response  401
  • Headers
    Content-Type: text/html
    WWW-Authenticate: Basic realm="Sylfide API"
  • Response  404
  • Headers
    Content-Type: text/html
  • Response  409
  • 409 Conflict is given when the user cannot be deleted because they are not in the correct state. The user must be inactive and cannot have any active entries in the account table.

    Body
    - Could not delete user in this state.

User activation resource 

Activate user
/id/users/{connectId}/activate

Puts a user into the active state.

Request document parameters:

  • connectId (string, required) - The CONNECT Id of the user to activate.

  • password (string, required) - The password to set on the user.

  • activationCode (string, required) - The activation code for the user.

  • mailId (string, optional) - An optional mailId. The mail corresponding to this mail id will be verified.

  • realname (string, optional) - The real name of the user.

  • birthdate (string, optional) - The birth date of the user we want to activate.

  • Parameters
  • connectId
    string (required) 

    The CONNECT ID.

  • Request
  • Headers
    Content-Type: application/json
    Accept: application/json
    Authorization: Basic <Base64 encoding of username:password>
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    <user response object>
    
  • Response  401
  • Headers
    Content-Type: text/html
    WWW-Authenticate: Basic realm="Sylfide API"
  • Response  404
  • Headers
    Content-Type: text/html
  • Response  409
  • Body
    - User is already activated
    - Mail is already verified
    
  • Response  500
  • Body
    - User activation failed
    - Activation error
    
  • Response  400
  • Body
    - Birthdate not properly formatted
    - Invalid activation code
    

User services resource 

Get all services on user
/id/users/{connectId}/services

Get a list of all services that a user has logged in to.

  • Parameters
  • connectId
    string (required) 

    The CONNECT ID.

  • Request
  • Headers
    Content-Type: application/json
    Accept: application/json
    Authorization: Basic <Base64 encoding of username:password>
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
      "service": [
        {
          "userid": "<userid>",
          "servicename": "capture",
          "firstaccesstime": "2015-08-17T11:23:07.823Z",
          "lastaccesstime": "2015-09-25T07:19:59.083Z"
        },
        {
          "userid": "<userid>",
          "servicename": "mypage"
        }
      ]
    }
  • Response  404
  • In case the user can not be found.

    Headers
    Content-Type: application/html
  • Response  500
  • Headers
    Content-Type: application
    Body
    Unexpected response. responseCode=<code> message=<message>

User service resource 

Get service info
/id/users/{connectId}/services/{serviceName}

Get info about a service for a user.

  • Parameters
  • connectId
    string (required) 

    The CONNECT ID.

    serviceName
    string (required) 

    The service id/name

  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
      "userid": "<userid>",
      "servicename": "capture",
      "firstaccesstime": "2015-08-17T11:23:07.823Z",
      "lastaccesstime": "2015-09-25T07:19:59.083Z"
    }
  • Response  404
  • When the user does not have the specific service, or the user is not found

  • Response  500
  • Headers
    Content-Type: application
    Body
    Unexpected response. responseCode=<code> message=<message>

User terms and conditions resource 

The user terms and conditions resource has the following attributes:

  • version string

    The requested version.

    Example: “20140428”

  • locale string

    The requested locale of the terms and conditions. Example: “en”

Accept terms and conditions
/id/users/{connectId}/tnc
  • Parameters
  • connectId
    string (required) 

    The CONNECT ID.

  • Request
  • Headers
    Content-Type: application/json
    Accept: application/json
    Authorization: Basic <Base64 encoding of username:password>
  • Response  200
  • Body
    {
      "acceptedDate": "2015-10-29T11:12:10.582Z",
      "locale": "en",
      "userid": "5938657091072827392",
      "version": "20140428"
    }
  • Response  404
  • Body
    "User not found: <connectId>"
  • Response  409
  • Body
    "Concurrent modification."
  • Response  500

User latest terms and conditions resource 

Check if the user has accepted the latest terms and conditions.

Signal that a user has accepted the latest terms and conditions
/id/users/{connectId}/tnc/latest
  • Parameters
  • connectId
    string (required) 

    The CONNECT ID.

  • Response  200
  • If the post was successful.

    Body
    {
      "acceptedDate": "2015-10-29T11:12:10.582Z",
      "locale": "en",
      "userid": "5938657091072827392",
      "version": "20140428"
    }
  • Response  404
  • In case the user can not be found.

  • Response  409
  • In case the version did not match the latest version of the terms and conditions or the user object is modified concurrently.

Check if a user has accepted the latest terms and conditions
/id/users/{connectId}/tnc/latest
  • Parameters
  • connectId
    string (required) 

    The CONNECT ID.

  • Response  200
  • If the user has accepted the latest terms and conditions.

    Body
    {
      "acceptedDate": "2015-10-29T11:47:30.689Z",
      "locale": "en",
      "userid": "5938657091072827392",
      "version": "20140428"
    }
  • Response  404
  • In case the user has not accepted the latest terms and conditions (or the user is not found).

User accepted terms and conditions resource 

Get the terms and conditions info a user has accepted
/id/users/{connectId}/tnc/accepted
  • Parameters
  • connectId
    string (required) 

    The CONNECT ID.

  • Response  200
  • If the user has ever accepted a version of the terms and conditions.

    Body
    {
      "acceptedDate": "2013-10-29T11:47:30.689Z",
      "locale": "en",
      "userid": "5938657091072827392",
      "version": "20121412"
    }
  • Response  404
  • In case the user has never accepted any terms and conditions (or the user is not found).

© 2017 Telenor Digital AS