Data sources
Create a data source
Mock APIs
Teams
Organisations
Data sources
Database connections
Usage
Access control
Stub Mappings
- GETGet all stub mappings
- POSTCreate a new stub mapping
- DELDelete all stub mappings
- POSTReset stub mappings
- POSTPersist stub mappings
- POSTImport stub mappings
- GETGet stub mapping by ID
- PUTUpdate a stub mapping
- DELDelete a stub mapping
- POSTFind stub mappings matching metadata
- POSTDelete stub mappings matching metadata
Requests
Data sources
Create a data source
POST
/
v1
/
users
/
{userId}
/
data-sources
Authorization
object
*
Authorization
Required
object
Basic authentication header of the form Basic <encoded-value>
, where <encoded-value>
is the base64-encoded string username:password
.
username
string
username
string
password
string
password
string
userId
string
*
userId
Required
string
object
*
dataSource
CSV · object
*
dataSource
Required
object
name
string
*
name
Required
string
The name of the data source, for display purposes.
type
enum<string>
type
enum<string>
The type of the data source. The type of a data source dictates where the data source's data comes from.
columnsMetadata
array
*
columnsMetadata
Required
array
A description of the format of each column of the data source's data.
rows
array
*
rows
Required
array
The data source's data. Each item in the outer array represents a row, while each item in each inner array represents a cell in that row.
curl --request POST \
--url https://wmc.wiremockapi.cloud/v1/users/{userId}/data-sources \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '{
"dataSource": {
"name": "My data source",
"type": "CSV",
"columnsMetadata": [
{
"name": "fullname",
"type": {
"name": "STRING"
}
},
{
"name": "dob",
"type": {
"name": "DATE",
"format": "iso8601"
}
},
{
"name": "admin",
"type": {
"name": "BOOLEAN"
}
},
{
"name": "retryLimit",
"type": {
"name": "INTEGER"
}
}
],
"rows": [
[
"Alice S",
"1975-05-31",
"true",
"3"
],
[
"Bob B",
"1959-11-16",
"false",
"1"
],
[
"Sam M",
"1999-07-02",
"false",
"0"
]
]
}
}'
{
"dataSource": {
"id": "abc123",
"aclObject": "jkl789",
"name": "My data source",
"lastUpdatedTime": "2024-01-17T11:46:13.481826Z",
"version": 3,
"type": "CSV",
"columnsMetadata": [
{
"name": "fullname",
"type": {
"name": "STRING"
}
},
{
"name": "dob",
"type": {
"name": "DATE",
"format": "iso8601"
}
},
{
"name": "admin",
"type": {
"name": "BOOLEAN"
}
},
{
"name": "retryLimit",
"type": {
"name": "INTEGER"
}
}
],
"state": "ENABLED",
"links": {
"self": "/v1/data-sources/abc123",
"acl": "/v1/data-sources/abc123/acl{?subjectId}"
}
}
}
Authorizations
Authorization
string
headerrequiredBasic authentication header of the form Basic <encoded-value>
, where <encoded-value>
is the base64-encoded string username:password
.
Path Parameters
userId
string
requiredBody
application/json
dataSource
object
requiredResponse
201 - application/json
dataSource
object
requiredcurl --request POST \
--url https://wmc.wiremockapi.cloud/v1/users/{userId}/data-sources \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '{
"dataSource": {
"name": "My data source",
"type": "CSV",
"columnsMetadata": [
{
"name": "fullname",
"type": {
"name": "STRING"
}
},
{
"name": "dob",
"type": {
"name": "DATE",
"format": "iso8601"
}
},
{
"name": "admin",
"type": {
"name": "BOOLEAN"
}
},
{
"name": "retryLimit",
"type": {
"name": "INTEGER"
}
}
],
"rows": [
[
"Alice S",
"1975-05-31",
"true",
"3"
],
[
"Bob B",
"1959-11-16",
"false",
"1"
],
[
"Sam M",
"1999-07-02",
"false",
"0"
]
]
}
}'
{
"dataSource": {
"id": "abc123",
"aclObject": "jkl789",
"name": "My data source",
"lastUpdatedTime": "2024-01-17T11:46:13.481826Z",
"version": 3,
"type": "CSV",
"columnsMetadata": [
{
"name": "fullname",
"type": {
"name": "STRING"
}
},
{
"name": "dob",
"type": {
"name": "DATE",
"format": "iso8601"
}
},
{
"name": "admin",
"type": {
"name": "BOOLEAN"
}
},
{
"name": "retryLimit",
"type": {
"name": "INTEGER"
}
}
],
"state": "ENABLED",
"links": {
"self": "/v1/data-sources/abc123",
"acl": "/v1/data-sources/abc123/acl{?subjectId}"
}
}
}