Empty token

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • eddieadams
    Junior Member
    • Apr 2015
    • 16

    Empty token

    /api/v1/App/user

    results in an empty token:
    public 'token' => null
  • tarasm
    Super Moderator
    • Mar 2014
    • 573

    #2
    Please, describe more detail your problem.
    Job Offers and Requests

    Comment

    • eddieadams
      Junior Member
      • Apr 2015
      • 16

      #3
      Authentication

      EspoCRM API uses Basic Authentication. Username and password/token are passed through Authorization header encoded in base64.
      "Authorization: Basic " + base64Encode(userName + ':' + passwordOrToken)
      The proper way of work with api:
      1. Obtain access token by GET App/user request with username and password passed in Authorization header.
      2. Use this token instead of password in Authorization header for all further request.
      3. If request return 403 error that means erither username/password is wrong or token is not valid anymore.
      Authentication Token / User Specific Data

      GET App/user
      Returnts:
      • token - access token to use;
      • acl - information about user access;
      • preferences - user preferences;
      • user - user record attributes.

      Comment

      • eddieadams
        Junior Member
        • Apr 2015
        • 16

        #4
        public 'token' => null ???

        Comment

        • yuri
          Member
          • Mar 2014
          • 8627

          #5
          There is a missed thing in documentation.

          You can not to use token. That's how you auth now. To obtain token you need to path HTTP HEADER Espo-Authorization: base64Encode(userName + ':' + passwordOrToken)
          If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

          Comment

          • yuri
            Member
            • Mar 2014
            • 8627

            #6
            I've fixed documentation,
            If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

            Comment

            Working...