Developer Guides
  • Introduction
    • Welcome
  • Core
    • Overview
    • Frontend
      • Implementation & Testing
      • Using the API endpoints
      • Gift cards
        • Gift Card validation API (Optional)
      • Check stock
      • Sibling products
      • Rewards program
      • Customer signatures
      • Retail transactions
      • Shopify Local Pick-up
  • API
    • Overview
    • Quick Start
    • Accounts
    • Changelog
    • Reference
      • Customers
      • Inventory
      • Orders
      • Products
      • Rewards
      • Stores
      • Vouchers
      • Staff
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. API

Accounts

PreviousQuick StartNextChangelog

Last updated 1 year ago

Was this helpful?

The endpoints listed on this page are used for managing user authentication within DotApparel API. It typically includes endpoints for creating, updating, and deleting user accounts:

  1. Creating Users: The administrator is able to generate new user credentials with an assigned role.

  2. Updating Users: The administrator has the ability to modify the role or reset the password of a specific API user.

  3. Deleting Users: The administrator has the authority to revoke a user's authentication.

This document is restricted to the administrator user only. If you wish to access other endpoints, please head to the API Reference.

Our base domain URL is https://api.dotapparel.io.

Make sure to include your username and password in the request header as described in the Authentication section above, as well as the X-DotApparel-Name header with the correct value for your account.

Reference

Delete API user

delete

Scope: admin

This endpoint deletes an existing API user by accepting required email.

The response does not include a response body, only a response code. If the user is successfully deleted, the server will respond with a 204 No Content status code.

Authorizations
Query parameters
emailstringRequired

The email address of the user to delete.

Header parameters
X-DotApparel-NamestringRequired

An alias name that represents a particular brand that is using the API

shopstringRequired
Responses
200
Successful response
application/json
400
Bad Request: The user with the specified email was not found.
401
Unauthorized: The user is not authorized to perform this action.
403
Forbidden: The user does not have permission to perform this action.
delete
DELETE /user?email=text HTTP/1.1
Host: 
Authorization: Basic username:password
X-DotApparel-Name: text
shop: text
Accept: */*
{
  "data": [
    "text"
  ]
}

List all API users

get

Scope: admin

This endpoint returns a list of all existing API users.

Authorizations
Header parameters
X-DotApparel-NamestringRequired

An alias name that represents a particular brand that is using the API

shopstringRequired
Responses
200
Successful response
application/json
401
Unauthorized: The user is not authorized to perform this action.
403
Forbidden: The user does not have permission to perform this action.
get
GET /user/list HTTP/1.1
Host: 
Authorization: Basic username:password
X-DotApparel-Name: text
shop: text
Accept: */*
{
  "data": [
    {
      "email": "your_email@example.com",
      "hash": "hash",
      "role": "visitor"
    }
  ]
}
  • POSTCreate new API user
  • PUTReset password or modify role for existing API user
  • DELETEDelete API user
  • GETList all API users

Create new API user

post

Scope: admin

This endpoint creates a new API user by accepting required information, including email, password, and role.

The endpoint checks that all required fields are present and that the email is not already associated with an existing user record. The role must be chosen from a predefined list of roles, including maintainer or visitor.

If the required information is valid, the endpoint creates a new user record with the specified email, password, and role and returns a success message with the new user's ID or a JSON object containing their information

Authorizations
Header parameters
X-DotApparel-NamestringRequired

An alias name that represents a particular brand that is using the API

shopstringRequired
Body
emailstringRequiredExample: your_email@example.com
passwordstringRequiredExample: your_password
rolestring · enumRequiredExample: visitorPossible values:
Responses
201
Successful response
application/json
400
Bad Request: The request body was invalid.
401
Unauthorized: The user is not authorized to perform this action.
post
POST /user HTTP/1.1
Host: 
Authorization: Basic username:password
X-DotApparel-Name: text
shop: text
Content-Type: application/json
Accept: */*
Content-Length: 78

{
  "email": "your_email@example.com",
  "password": "your_password",
  "role": "visitor"
}
{
  "data": {
    "email": "your_email@example.com",
    "hash": "hash",
    "role": "visitor"
  }
}

Reset password or modify role for existing API user

put

Scope: admin

This endpoint allows for the updating of an existing user with a specific email by changing the role or resetting the password.

The endpoint accepts a JSON object in the request body that contains the new values for the user's email, password, and role. The email field is required but cannot be changed. The password field will be encrypted and stored in the database. The role field must be chosen from maintainer or visitor.

Authorizations
Header parameters
X-DotApparel-NamestringRequired

An alias name that represents a particular brand that is using the API

shopstringRequired
Body
emailstringRequired
passwordstringOptional
rolestring · enumOptionalExample: visitorPossible values:
Responses
200
Successful response
application/json
400
Bad Request: The request body was invalid.
401
Unauthorized: The user is not authorized to perform this action.
404
Not Found: The user with the specified userId was not found.
put
PUT /user HTTP/1.1
Host: 
Authorization: Basic username:password
X-DotApparel-Name: text
shop: text
Content-Type: application/json
Accept: */*
Content-Length: 51

{
  "email": "text",
  "password": "text",
  "role": "visitor"
}
{
  "data": {
    "email": "your_email@example.com",
    "hash": "hash",
    "role": "visitor"
  }
}