user3793310
user3793310

Reputation: 161

GoodData "Create Report Definition" API Call giving 500 Internal Server Error

I'm trying to create a report definition using the GoodData REST API. I use the following endpoint to invoke the rest call.

"/gdc/md/{project-id}/obj"

When i try to invoke the API call with the following dataset in which the projectId and the userId are valid, it gives me the error with the response code 500.

{
 "reportDefinition": {
    "content": {
    "filters": [],
    "format": "grid",
    "grid": {
        "rows": [],
        "columns": [
            "metricGroup"
        ],
        "sort": {
            "columns": [],
            "rows": []
        },
        "columnWidths": [],
        "metrics": [
            {
                "uri": "/gdc/md/qy48iv4flikdlcwpwioizuip74wt8nb5/obj/63f3cecd2a8d3ce2ec9378381c8f39e3",
                "alias": ""
            }
        ]
    }
},
"meta": {
    "title": "Sample report definition",
    "summary": "This is a sample report",
    "tags": "",
    "deprecated": 0,
    "category": "samplecategory"
    }
  }
} 

{
    "error": {
        "message": "Internal server error. Please fill in bug report with request_id='lp78FL5S1IPMqB2n'"
    }
}

I'm certain that the user project_id and the user_id are valid. Is this an error in the API?

Thank you in advance.

Upvotes: 0

Views: 199

Answers (2)

Michal Hauzirek
Michal Hauzirek

Reputation: 345

Apart from the metrics URI that looks weird (hash instead of numeric ID), I was able to dig in our logs an error that says: "Category is not equal to tag structure".

In your example you have its value set to "samplecategory". "category" property defines what type of object are you creating. If you are creating a report definition it should have value of "reportDefinition".

Upvotes: 1

Tomáš Janoušek
Tomáš Janoušek

Reputation: 10727

Last time I worked with GoodData API, metrics had numeric IDs. That seems most likely to be the culprit. Where did you get "/gdc/md/qy48iv4flikdlcwpwioizuip74wt8nb5/obj/63f3cecd2a8d3ce2ec9378381c8f39e3" from, especially the "63f3cecd2a8d3ce2ec9378381c8f39e3" part?

Upvotes: 0

Related Questions