Developer Guide
Authentication
    In order to work with Magentrix entities, authentication must be performed unless explicit permission has been given to the Everyone role. There are two methods to Authenticate with Magentrix:
     

    Authentication

    This method does not support sliding expiration. However, after authentication, a session id is provided. This session id must be set as Authorization Header in every request; cookies are not required. The client application is responsible for making sure that the session id is still valid when making request calls. In order to perform the second type of authentication the following HTTP POST call must be made:

    https://<your-portal-domain>/rest/2.0/login
    OR
    https://<instance>.magentrixcloud.com/rest/2.0/login
    
    Body Payload (form submission):
    un=<username>&pw=<password>
    
     
     

    Here's an example of a response body in JSON format:

    {
        "DateIssued": "2014-03-04T18:28:43.5377858Z",
        "ValidUntil": "2014-03-04T22:28:43.5377858Z",
        "Errors": [],
        "IsSuccess": true,
        "SessionId": "<sessionid>"
    }
     

    Here's an example of the response body if the login failed:

    {
        "DateIssued": "2014-03-04T18:28:43.5377858Z",
        "ValidUtil": null,
        "Errors": [
            {
                "Message": "Login failed.",
                "PropertyName": null
            }
        ],
        "IsSuccess": false,
        "SessionId": null
    }

     

     

    CreateSession method

    Use a HTTP POST with body payload.

    https://<your-portal-domain>/rest/2.0/createsession
    {
        "UserName":"username",
        "Password":"password"
    }

    Login Success

    {
      "SessionId": "sessionId",
      "DateIssued": "2019-11-21T21:25:28.0583347Z",
      "ValidUntil": "2019-12-21T21:25:28.0583347Z",
      "IsSuccess": true,
      "Errors": []
    }

    Login Failed

    {
      "SessionId": null,
      "DateIssued": "2019-11-22T18:34:50.4506867Z",
      "ValidUntil": "0001-01-01T00:00:00",
      "IsSuccess": false,
      "Errors": [
        {
          "Code": null,
          "PropertyName": null,
          "Message": "Login failed."
        }
      ]
    }