Always get Error 500 when try to create category

Im trying to create a category using Api, always fails with Error 500 for both

curl -s -X POST --data "name=Fred&color=0xffffff&text_color==0xbbbbbb&api_key=*API_USER_KEY*&api_username=*USER_NAME*" https://community.jthink.net/categories

and

curl -s -X POST --data "name=Fred&color=0xffffff&text_color==0xbbbbbb&api_key=*API_USER_KEY*&api_username=*USER_NAME*" https://community.jthink.net/categories.json

and when called with java code.

My api key etc are okay, and I can get creating user via api to work okay.

What am I doing wrong ?

1 Like

Is the text color parameter supposed to have the double == symbol?

1 Like

Right thankyou, okay that fixes curl, unfortunately that works but doesnt explain Java issue, I was only using curl to try and work out what the Java issue was.

1 Like

You didn’t explain what you’re doing in Java, so that’s impossible to answer… (also, I don’t know Java so I wouldn’t be able to help you with that anyway, sorry :slight_smile: )

That is true, well Im trying to do the same thing as curl, now at least I know the api does work as expected I will look at my code again to see if silly error in there.

I do have a couple if questions about the categories api though that you may be able to help with:

  1. Are there extra fields not shown in the api docs you can pass to the api when you create categories (such as category description) or not ?
    2, what are sensible values for color and text-color, is there some kind of defacto standard for assigning colors to different types of categories ?
2 Likes

Eventually found the issue, I was passing the colors wrong in my json, passing 0x24aae2 instead of 24aae2

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.