Your first request

Key concepts covered
  • Understanding Core Functionality
  • Developing Practical Skills
  • Applying Best Practices
  • Troubleshooting Common Issues
  • Integrating Components
  • Lifecycle Management
  <th style={{ textAlign: "left" }}>
    Estimated time
  </th>

  <th style={{ textAlign: "left" }}>
    Platforms
  </th>

  <th style={{ textAlign: "left" }}>
    Technologies used
  </th>
</tr>
  <td style={{ textAlign: "left" }}>
    <img src="https://files.readme.io/1018dff-clock10.png" alt="10 min" style={{ width: "25px" }} />
  </td>

  <td style={{ textAlign: "left" }}>
    <img src="https://files.readme.io/53ea389-Windows_10x_Icon.png" alt="Windows" /> <img src="https://files.readme.io/a7eff83-apple_logo.png" alt="Apple" /> <img src="https://files.readme.io/b06c556-linux_logo.png" alt="Unix" style={{ width: "20px" }} />
  </td>

  <td style={{ textAlign: "left" }}>
    cUrl
  </td>
</tr>
Difficulty
Easy difficulty level
Prerequisites
Before getting started with your first request, make sure you understand the following topics from the Quick start section:<ul style={{ marginTop: "-5px", marginBottom: "-5px" }}>
  • Requirements - Especially about how to get an account.
  • Base URLs and environments - Especially the part about the base URL for the Sandbox environment.
  • Sandbox environments - Especially the "Testing in sandbox" section.
  • APIs
    • [Who am I](ref:whoami) (`GET /user/v3/account/whoAmI`)

    Sending a "Who Am I" request

    A good place to start getting familiar with our API is by sending a request to the Who am I endpoint.

    A successful request to this endpoint returns information about the user whose credentials have been used to authenticate the request, including the following:

    • First Name
    • Last Name
    • Username
    • A list of merchants to which the user has access rights

    To send a whoAmI request, do the following:

    1. Generate your basic authentication for the API user by doing the following:

      a. Open a Unix prompt, such as Cygwin (on Windows) or Terminal (on Mac OS X).

      b. Type the following, replacing "username" and "password" with your own authentication for the sandbox environment:

      echo -n username:password | base64
      

      c. Copy the result and paste it to a text editor for later use.

    2. Send a GET request to the Who am I endpoint. The example below uses cURL for sending the request.

      curl -X GET https://api.nexiopaysandbox.com/user/v3/account/whoAmI \
        -H 'Accept: application/json' \
        -H 'Authorization: Basic [Base64_encoded_login]'
      

      [
        {
          "userName": "[email protected]",
          "accountType": "MERCHANT",
          "enabled": true,
          "firstName": "John",
          "lastName": "Doe",
          "phone": "15555555555",
          "address1": "2147 West Silverlake Drive",
          "address2": "Ste. 42",
          "city": "Scranton",
          "state": "PA",
          "postalCode": "18503",
          "country": "US",
          "businessLegalName": "[Business legal name]",
          "billingContactFullName": "John Doe",
          "billingContactPhone": "15555555555",
          "billingContactEmail": "[email protected]",
          "isApiUser": true,
          "isEnabledAuthorizedStatus": false,
          "isEnabledForCybersourceAccountUpdater": false,
          "isEnabledForAccountUpdater": false,
          "accessRights": {
            "merchantIds": {
              "100039": "A"
            },
            "role": "A"
          },
          "payoutAccessRights": {
            "3927": "A"
          },
          "loginInfo": {
            "count": 5,
            "lastLogin": "2023-05-26T23:12:02.571Z"
          },
          "notifications": {
            "chargebacks": true,
            "largeExports": true,
            "fraud": true,
            "payoutBatches": true
          },
          "role": "string",
          "dateCreated": "2018-09-27T14:27:39.626Z",
          "dateLastModified": "2019-03-08T00:58:27.893Z",
          "accountId": "[account_id]",
          "cognitoSub": "[cognito_sub]",
          "isEnabledForVTerm": true,
          "shouldShowPlatformAgreement": true,
          "shouldShowPricingAgreement": true
        }
      ]
      

    See Also

    For additional information about users, see the following:

    • Sandbox environments - For information about the Sandbox environment and the features referenced in the "WhoAmI" endpoint response.
    • User roles - For information about the different types of roles referenced in the response.
    • Authentication - For information about the different ways to authenticate with the Nexio APIs.