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
OpenAPI
Imports
Update data source
Basic authentication header of the form Basic <encoded-value>
, where <encoded-value>
is the base64-encoded string username:password
.
The name of the data source, for display purposes.
The type of the data source. The type of a data source dictates where the data source's data comes from.
A description of the format of each column of the data source's data.
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 PUT \
--url https://wmc.wiremockapi.cloud/v1/data-sources/{dataSourceId} \
--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
Basic authentication header of the form Basic <encoded-value>
, where <encoded-value>
is the base64-encoded string username:password
.
Path Parameters
Body
The name of the data source, for display purposes.
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.
The type of the data source. The type of a data source dictates where the data source's data comes from.
CSV
Response
CSV
ENABLED
, DISABLED
curl --request PUT \
--url https://wmc.wiremockapi.cloud/v1/data-sources/{dataSourceId} \
--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}"
}
}
}