Profile REST API

For all the services you can specify if you want the response to be in JSON or XML using the Accept header in the standard way. It's also possible to specify preferred language for labels that need to be localized, use ?lang=langcode for that, otherwise the Accept-Language header is respected.

Create profile

  http://profile.vtt.fi/api/profile/
    POST
      - consumerKey (*)
      - consumerSecret (*)
      - email (*)
      - firstname (*)
      - lastname (*)

    Creates a profile. The user will get sent a confirmation email.
    
    To see their profile on the server, the user should follow
    the link sent to them during registration.
    
    For testing, use an email ending @test.invalid. For cases
    where there's no email, use @noemail.invalid.

    @return 201 Created - on success
       * the Location header is set to the profile location
       * the profile data is returned in the document content (json or xml)
       * profile.oauthToken contains the OAuth token to be used for
                            profile access/modification
       * profile.oauthTokenSecret contains the OAuth token secret to be
                                  used for profile access/modification
    @return 400 Bad request - if any required parameters are missing
    @return 401 Unauthorized - if the credentials are incorrect
    @return 409 Conflict - if there is already a user with the given email

Read profile

  http://profile.vtt.fi/api/profile/<profile_id>
    GET
      - format (optional) "NORMAL" or "FULL" specifying how much semantic
        info to include
      
      A) If profile id given on patch, read the corresponding profile.
      B) No profile id was given on path - use OAuth to determine profile 

    @return 200 OK, or 204 No content - on success
       * the profile data is included in the response (json or xml)
    @return 400 Bad request - if any required parameters are missing/invalid
    @return 404 Not found - when the profile wasn't found

Update profile tag

  http://profile.vtt.fi/api/profile/tag
    POST
      - label (*)
      - language    ISO 639-2 language code of the label
      - uri     semantic LOD uri of the label
      - description description for this tag
      - goodness like/hate value 0-2, 0 for hate, 1 for like, 2 for love
      - coLabel labels used together with this tag
      - format  "NORMAL" or "FULL" specifying how much semantic info to include

    Use OAuth to determine profile.

    @return 200 OK - on successful update
       * the profile data is returned in the document content (json or xml)
       * site profiles can't be created/updated/deleted by api calls
    @return 201 OK - on successful creation
       * the profile data is returned in the document content (json or xml)
       * site profiles can't be created/updated/deleted by api calls
    @return 400 Bad request - if any required parameters are missing/invalid

Update profile meta

  http://profile.vtt.fi/api/profile/meta
    POST
      - firstname
      - lastname
      - gender (MALE/FEMALE)
      - format (NORMAL/FULL)  how much semantic info to include
      - other meta:
        * hometown          the hometown name
        * hometownURI       lod uri of the hometown
        
        * workwiseRole      semantic uri of the role
        * familyToddler     have children <=2 yrs
        * familySmallChild  have children 3-6 yrs
        * familySchoolChild have children 7-12 yrs
        * familyTeenager    have children 13-18 yrs
        * familyGrownChild  have children 18+ yrs
        * familyNoChild     no children in the family
        
        * appleDeviceToken  device token for the Apple Push Notification service
        * appleDeviceTokenDev  device token (for development version)

    Use OAuth to determine profile.

    @return 200 OK - on success
       * the profile data is returned in the document content (json or xml)
    @return 400 Bad request - if any required parameters are missing/invalid
    @return 403 Forbidden - changing is not allowed. This is the case if the
                            user has taken control of the profile
                            (on the profile service)

Delete profile

  http://profile.vtt.fi/api/profile/
    DELETE
    
    Use OAuth to determine profile.

    @return 204 No Content - on success
    @return 400 Bad request - if any required parameters are missing/invalid
    @return 401 Unauthorized - if the credentials are incorrect
    @return 403 Forbidden - if the user has taken control of his profile we
                            can't delete it through using the API anymore

Delete profile tag

  http://profile.vtt.fi/api/profile/tag
    DELETE
      - id (tag id)
        OR
      - label
      - uri

    @return 204 No Content - on success
    @return 400 Bad request - if any required parameters are missing/invalid
    @return 401 Unauthorized - if the credentials are incorrect
    @return 403 Forbidden - if this isn't one of "your" tags
    @return 404 Not found - if the tag wasn't found

Read recommendations

   http://profile.vtt.fi/api/recommendations/<id>
     GET

      A) If profile id given on patch, read the corresponding profile.
      B) No profile id was given on path - use OAuth to determine profile 

       - lang  language code
           value: fi, en, sv ...
       - max   max number of recommendations to return
           value: integer
       - pid (profiles to use for secondary recommendations)
           value: multiple. e.g. &pid=19&pid=20&pid=21
      @return 200 OK - on success
       * the recommendation data is included in the response (json or xml)
      @return 400 Bad request - if any required parameters are missing/invalid
      @return 401 Unauthorized - if the credentials are incorrect
      @return 404 Not Found if the profile wasn't found

Example usage / testing

Re OAuth, see the OAuth info page.


Host base url to use in the api calls. e.g. http://profile.vtt.fi/ or http://espvm3k985.ad.vtt.fi:8080/crossmedia/ - leave empty to use current host.

Create Profile


Your application's OAuth consumer key


Your application's OAuth consumer secret

(use an email ending in .invalid for testing)

Read Profile

Read Profile using ID


The profile service profile id; e.g. a2cf76f0-39c9-11e0-9207-0800200c9a66

format (optional):
NORMAL or FULL specifying how much semantic info to include

Read Profile using OAuth

format (optional):
NORMAL or FULL specifying how much semantic info to include


OAuth consumer key for your application


OAuth consumer key for your application


oauthToken access token for the profile to read


oauthToken access token secret for the profile to read

Update Profile

Update Profile Tag


Tag label; e.g. rock

(optional)
Tag language code; e.g. "fi", "en", "sv"


Meaning uri of the tag; e.g. http://www.w3.org/2006/03/wn/wn20/instances/synset-rock__n__roll-noun-1


Tag description; e.g. a genre of popular music...


Tag goodness; how important the user finds the tag (0-2, 1 is normal).


Label used together with this tag.

format (optional):
NORMAL or FULL specifying how much semantic info to include.


OAuth consumer key for your application


OAuth consumer key for your application


oauthToken access token for the profile to update


oauthToken access token secret for the profile to update

Update Profile Info


MALE or FEMALE


Birthday; yyyy-MM-dd


A meta data field.


A meta data field.

SP3 roles (meta)

format:
NORMAL or FULL specifying how much semantic info to include.


OAuth consumer key for your application


OAuth consumer key for your application


oauthToken access token for the profile to update


oauthToken access token secret for the profile to update

Delete

Delete Profile Tag


OAuth consumer key for your application


OAuth consumer key for your application


oauthToken access token for the profile to delete


oauthToken access token secret for the profile to delete


id of tag to delete

Delete Profile


OAuth consumer key for your application


OAuth consumer key for your application


oauthToken access token for the profile to delete


oauthToken access token secret for the profile to delete


Recommendations

Read recommendations for id


Profile id; e.g. a2cf76f0-39c9-11e0-9207-0800200c9a66 or http://example.myopenid.com


Utilities

Console