Cloud Mock is Apidog's cloud-hosted mock server that provides 24/7 availability and team-wide access. Unlike Local Mock (which runs on your computer), Cloud Mock is deployed on Apidog's servers, making it accessible from anywhere, anytime.In this article, we'll learn how to enable and use Cloud Mock for the Pet Store API, enabling better team collaboration and continuous availability.
1. What Is Cloud Mock?#
Cloud Mock is a mock server hosted on Apidog's cloud infrastructure. Unlike Local Mock (which runs on your computer), Cloud Mock runs on Apidog's servers, providing:24/7 availability: Works even when your computer is off
Team-wide access: All team members share the same mock URLs
Accessible from anywhere: Use it from any device or location
Ideal for collaboration: Perfect for team development, public documentation, and CI/CD pipelines
Cloud Mock vs. Local Mock#
| Feature | Local Mock | Cloud Mock |
|---|
| Location | Your computer | Apidog's servers |
| Availability | Only when Apidog is open | 24/7, always available |
| Access | Personal (each team member has their own) | Shared (team-wide) |
| Best for | Local development and debugging | Team collaboration, public APIs, CI/CD |
2. When to Use Cloud Mock#
Use Cloud Mock when you need:Team collaboration: Multiple developers need to access the same mock data
Continuous integration: CI/CD pipelines need always-available mock endpoints
Public documentation: Share mock APIs in public API documentation
Remote access: Access mock data from different devices or locations
Stable testing: Need mock endpoints that don't depend on individual machines
3. Enabling Cloud Mock#
Let's enable Cloud Mock for your Pet Store API project:Step 1: Open Project Settings#
1.
In your Apidog project, click the Settings icon (usually in the top-right corner)
2.
Select "Project Settings"
3.
Navigate to "Mock Settings"
Step 2: Enable Cloud Mock#
1.
Find the "Cloud Mock" toggle
3.
Cloud Mock is now enabled for your project
4. Using Cloud Mock#
Once enabled, you can access Cloud Mock in several ways:Method 1: Get Cloud Mock URL#
1.
Open any endpoint in your project (e.g., GET /pets/{id})
3.
Click the "Cloud Mock" button
https://mock.apidog.com/m1/1138249-1130478-default/pets/{id}
For example, to get a pet with ID pet_1Nv0FGQ9RKHgCVdK:https://mock.apidog.com/m1/1138249-1130478-default/pets/pet_1Nv0FGQ9RKHgCVdK
1.
In the Mock tab, click the "Request" button
2.
Apidog will send a request to the Cloud Mock server
3.
View the response in the response panel
Method 3: Switch Environment#
1.
In the top-right corner, click the environment switcher
2.
Select "Cloud Mock" from the dropdown
3.
All requests in Apidog will now go to Cloud Mock instead of the actual API
5. Access Control (Optional)#
For security, you can enable token authentication for Cloud Mock:Enable Token Authentication#
1.
Go to Project Settings β Mock Settings
2.
Set Access Permission to "Token Authentication"
3.
A token will be generated for your project
Using Authenticated Cloud Mock#
When token authentication is enabled, you need to include the token in your requests:https://mock.apidog.com/m1/1138249-1130478-default/pets/pet_1Nv0FGQ9RKHgCVdK?apidogToken=YOUR_TOKEN
Option 2: Header ParameterAdd apidogToken to your request headers:Option 3: Body Parameter (for form-data or x-www-form-urlencoded)Add apidogToken to your request body parameters.
6. Example: Using Cloud Mock with Pet Store API#
Let's see Cloud Mock in action:Step 1: Enable Cloud Mock#
1.
Enable Cloud Mock in Project Settings (as shown above)
Step 2: Get the Cloud Mock URL#
1.
Open GET /pets/{id} endpoint
3.
Click "Cloud Mock" to get the cloud mock URL
Step 3: Test the Cloud Mock#
2.
Replace {id} with a pet ID (e.g., pet_1Nv0FGQ9RKHgCVdK)
3.
Paste the URL in your browser or use it in your application
4.
You'll receive Smart Mock-generated data from the cloud
https://mock.apidog.com/m1/1138249-1130478-default/pets/pet_1Nv0FGQ9RKHgCVdK
{
"id": "pet_1Nv0FGQ9RKHgCVdK",
"species": "CAT",
"name": "Whiskers",
"breed": "Domestic Shorthair",
"ageMonths": 18,
"size": "MEDIUM",
"color": "Orange Tabby",
"gender": "MALE",
"goodWithKids": true,
"goodWithPets": true,
"adoptionFee": 75,
"description": "Friendly and playful orange tabby looking for a loving home",
"status": "AVAILABLE",
"intakeDate": "2024-06-15",
"photos": [
"https://cdn.petstoreapi.com/pets/pet_1Nv0FGQ9RKHgCVdK/photo1.jpg",
"https://cdn.petstoreapi.com/pets/pet_1Nv0FGQ9RKHgCVdK/photo2.jpg"
],
"medicalInfo": {
"spayedNeutered": true,
"vaccinated": true,
"microchipped": true,
"specialNeeds": false
}
}
You can also test other endpoints, such as:List Pets: GET https://mock.apidog.com/m1/1138249-1130478-default/pets
Create Pet: POST https://mock.apidog.com/m1/1138249-1130478-default/pets
Step 4: Share with Your Team#
Share the cloud mock URL with your team members. They can use the same URL to access the same mock data, ensuring consistency across the team.
7. Key Takeaways#
Cloud Mock provides 24/7 availability and team-wide access to mock APIs
Always available: Works even when your computer is off
Team collaboration: All team members share the same mock URLs
Easy to enable: Just toggle it on in Project Settings
Access control: Optional token authentication for security
Multiple access methods: URL, Request button, or environment switching
Same functionality: Supports Smart Mock, Mock Expectations, and Mock Scripts
Cloud Mock enables seamless team collaboration and continuous availability for your mock APIs. In the next article, we'll learn about Mock Scriptsβhow to create dynamic mock responses that maintain logical relationships between request and response data. Modified atΒ 2025-12-25 09:45:27