If you're in need of a sample REST API URL for testing purposes along with bearer token authentication, you're in the right place. This article will provide you with a free sample REST API URL that includes all the essential endpoints such as GET, POST, PUT, and DELETE. 

With this, you'll be able to easily execute operations like insertion, updating, and deletion within your application. Whether you're working with Python, JavaScript (including frameworks like React.js, Angular.js, or Vue.js), or any other platform, this API will seamlessly integrate.

We're offering the same sample for testing bearer token authentication, enabling you to authenticate your application using a bearer token. 

  • To begin, obtain a bearer token for accessing secure APIs. For this purpose, we've created an endpoint 'api/Auth/GetBearerToken', which returns a bearer token along with its expiration time. 
  • Once obtained, you'll need to include this bearer token in the header when calling secure endpoints. 

The following endpoint is designed to retrieve a bearer token. 

It's a simple GET API, To obtain the bearer token, simply open the URL in a web browser.

GetBearerTokenapi/Auth/GetBearerToken
Url: https://www.quickpickdeal.com/api/Auth/GetBearerToken
Response body
{
                    "Success": true,
                    "Error": null,
                    "Data": {
                    "Token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6Ijc1Yzg2YTA4LTRiYjYtNDIxMi1iYjJiLWU5ZjA1YWIxNzg3MSIsIm5iZiI6MTcwNzQ2NjA2OCwiZXhwIjoxNzA3NDY5NjY4LCJpYXQiOjE3MDc0NjYwNjgsImlzcyI6Imh0dHA6Ly9sb2NhbGhvc3Q6NjA2NDYiLCJhdWQiOiJodHRwOi8vbG9jYWxob3N0OjYwNjQ2In0.p8wwJqTyu99dEYVKON9kuzrPRcFCtOfYq3HgCdqWCXc",
                    "Created": "2024-02-09T08:07:48.4568912+00:00",
                    "Expires": "2024-02-09T09:07:48.2207299+00:00"
  }
}
API response
  • Success: Indicates whether the request was successful. In this case, it's marked as false, indicating an unsuccessful attempt. 
  • Error: Any error message associated with the request. It's currently null, suggesting no specific error occurred. 
  • Data: Contains the actual payload of the response. 
  • Token: The bearer token generated by the server. It's a long string of characters, representing the authentication token. 
  • Created: Specifies the date and time when the token was created. 
  • Expires: Indicates the expiration date and time of the token. After this time, the token will no longer be valid for authentication purposes.
 Now that you've received the bearer token, you can test your application using the following endpoint. Remember to include the bearer token in the request header before making the request.


Below is a straightforward GET API that retrieves a list of customers from the database. 

The product JSON object comprises fields such as Id, Email, FirstName, LastName, IsMaster, CreatedAt.



Get Customer Listapi/Customer/GetAllCustomers
Url: https://www.quickpickdeal.com/api/Customer/GetAllCustomers
{
                    "Success": true,
                    "Error": null,
                    "Data": [
    {
                    "Id": 1,
                    "Email": "[email protected]",
                    "FirstName": "John",
                    "LastName": "Doe",
                    "IsMaster": true,
                    "CreatedAt": "2024-02-17T12:40:14"
    },
    {
                    "Id": 2,
                    "Email": "[email protected]",
                    "FirstName": "Alice",
                    "LastName": "Smith",
                    "IsMaster": true,
                    "CreatedAt": "2024-02-18T12:40:14"
    },
    {
                    "Id": 3,
                    "Email": "[email protected]",
                    "FirstName": "Michael",
                    "LastName": "Johnson",
                    "IsMaster": true,
                    "CreatedAt": "2024-02-19T12:40:14"
    },
    {
                    "Id": 4,
                    "Email": "[email protected]",
                    "FirstName": "Emily",
                    "LastName": "Brown",
                    "IsMaster": true,
                    "CreatedAt": "2024-02-20T12:40:14"
    },
    {
                    "Id": 5,
                    "Email": "[email protected]",
                    "FirstName": "David",
                    "LastName": "Taylor",
                    "IsMaster": true,
                    "CreatedAt": "2024-02-21T12:40:14"
    },
    {
                    "Id": 6,
                    "Email": "[email protected]",
                    "FirstName": "Emma",
                    "LastName": "Wilson",
                    "IsMaster": true,
                    "CreatedAt": "2024-02-22T12:40:14"
    },
    {
                    "Id": 7,
                    "Email": "[email protected]",
                    "FirstName": "James",
                    "LastName": "Martinez",
                    "IsMaster": true,
                    "CreatedAt": "2024-02-23T12:40:14"
    },
    {
                    "Id": 8,
                    "Email": "[email protected]",
                    "FirstName": "Olivia",
                    "LastName": "Anderson",
                    "IsMaster": true,
                    "CreatedAt": "2024-02-25T12:40:14"
    },
    {
                    "Id": 9,
                    "Email": "[email protected]",
                    "FirstName": "William",
                    "LastName": "Lee",
                    "IsMaster": true,
                    "CreatedAt": "2024-02-25T12:40:14"
    },
    {
                    "Id": 10,
                    "Email": "[email protected]",
                    "FirstName": "Sophia",
                    "LastName": "Garcia",
                    "IsMaster": true,
                    "CreatedAt": "2024-02-28T12:40:14"
    }
  ]
}

The 'IsMaster' field denotes whether the product is a master product or not. Note that update and delete operations cannot be performed on master data. To execute these operations, you'll need to create your own product first, and then proceed accordingly.

If you're also interested in sample login or registration APIs for testing purposes, you can find them within this post.

The following endpoint is designed to fetch customer by their respective IDs. It requires the customer ID as a parameter and subsequently returns the corresponding product details. If the provided ID does not match any customer in the database, an error message will be generated.

GetCustomerByIdapi/Customer/GetCustomerById?id=2
Url: https://www.quickpickdeal.com/api/Customer/GetCustomerById?id=2
Response body
{
                    "Success": true,
                    "Error": null,
                    "Data": {
                    "Id": 2,
                    "Email": "[email protected]",
                    "FirstName": "Alice",
                    "LastName": "Smith",
                    "IsMaster": true,
                    "CreatedAt": "2024-02-18T12:40:14"
  }
}
Here is the POST API for adding a customer object to the database.
CreateCustomerapi/Customer/CreateCustomer
Url: https://www.quickpickdeal.com/api/Customer/CreateCustomer
Request body
{
                    "email": "[email protected]",
                    "firstName": "Carry",
                    "lastName": "Ting"
}
Response body
{
                    "Success": true,
                    "Error": null,
                    "Data": {
                    "Id": 12,
                    "Email": "[email protected]",
                    "FirstName": "Carry",
                    "LastName": "Ting",
                    "IsMaster": false,
                    "CreatedAt": "2024-03-04T12:04:11.2595699Z"
  }
}
Here's the PUT API for modifying a customer object in the database. Upon a successful update request, the API response will include the updated customer details.
Update Customerapi/Customer/EditCustomer?id=12
Url: https://www.quickpickdeal.com/api/Customer/EditCustomer?id=12
Request body
{
                    "email": "[email protected]",
                    "firstName": "Carry new",
                    "lastName": "Ting new",
                    "id":12
}
Response body
{
                    "Success": true,
                    "Error": null,
                    "Data": {
                    "Id": 12,
                    "Email": "[email protected]",
                    "FirstName": "Carry new",
                    "LastName": "Ting new",
                    "IsMaster": false,
                    "CreatedAt": "2024-03-04T12:04:11.259569"
  }
}


Here is the DELETE API for removing a customer object from the database. Upon a successful deletion request, the API response will include the details of the deleted customer
Delete customer api/Customer/DeleteCustomer?id=12
Url: https://www.quickpickdeal.com/api/Customer/DeleteCustomer?id=12
{
                    "Success": true,
                    "Error": null,
                    "Data": {
                    "Id": 12,
                    "Email": "[email protected]",
                    "FirstName": "Carry new",
                    "LastName": "Ting new",
                    "IsMaster": false,
                    "CreatedAt": "2024-03-04T12:04:11.259569"
  }
}