Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

API response: Metadata must be namespaced

David Maier September 15, 2022

Hello,

I'm using the manage API of Statuspage.

Currently I'm trying to create incidents programmatically. To be able to identify incidents when accessing them in the future, I'm trying to save an ID in the "metadata" key of the incident. However, when I try to do that, I get the following response:

{
"error":[
"Metadata Metadata must be namespaced"
]
}

 My request entity, the incident, looks like this:

{
"incident": {
"name": "Incident title",
"body": "Something is not working.",
"status": "investigating",
"component_ids": [ "abc123def456" ],
"metadata": {
"my_id": "123456789_test:hello"
}
}
}
 

 Does anybody know what this response means? Can't I use the metadata field?

 

Edit: This page of the API documentation suggests that there is a metadata field.

1 answer

1 accepted

1 vote
Answer accepted
David Maier September 15, 2022

As it turns out, I had to wrap"my_id" inside another object, which represents the namespace:

{
"incident": {
"name": "Incident title",
"body": "Something is not working.",
"status": "investigating",
"component_ids": [ "abc123def456" ],
"metadata": {
"my_namespace: {
"my_id": "123456789_test:hello"
}
}
}
}
 

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events