REST API? Documentation for <https://docs.growthbo...
# ask-questions
p
REST API? Documentation for https://docs.growthbook.io/api#tag/features/operation/getFeature shows the rules besides other things returned...
I get this
Copy code
{
  "feature": {
    "id": "x.x.x.x.x",
    "description": "",
    "archived": false,
    "dateCreated": "2024-06-12T10:13:07.047Z",
    "dateUpdated": "2024-06-12T11:37:59.138Z",
    "defaultValue": "{}",
    "environments": {
      "production": {
        "enabled": false,
        "defaultValue": "{}",
        "rules": []
      }
    },
    "owner": "X X",
    "project": "prj_xxxxxx",
    "tags": [],
    "valueType": "json",
    "revision": {
      "comment": "",
      "date": "2024-06-12T10:13:07.047Z",
      "publishedBy": "",
      "version": 1
    }
  }
}
as you can see the rules are empty [], is this normal? We are running our own Growthbook version 2.9.
f
are you expecting to see override rules there?
p
I do...and I found them, they weren't published. Sorry for the false alarm.
The other one that I couldn't get to work with the API - I cannot create a project, sending:
Copy code
curl -X POST '<https://growthbook-back-end.ourdomain.com/api/v1/projects>' \
-H 'User-Agent: biku' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer secret_admin_our_secret' \
-d '{
    "name": "Biku",
    "description": "Biku project"
}'
getting 404:
Copy code
{
  "message": "Unknown API endpoint"
}
f
huh
did you pass the secret too?
are you using an old version of GrowthBook?
p
yes, passing the same secret key to all the calls(
-H 'Authorization: Bearer secret_admin_our_secret'
) GrowthBook 2.9
f
I'm looking at the code
and it was added in 2023 - so 2.9 should be recent enough
the only way to get that error is if the api path doesn't match
its pretty straight forward code...
p
can you try a curl against your instance to create a project?
GETs work, it is the post that I get the error on
f
all POSTS or just this one?
p
no, only to create a project
all of it(GET/POST/PUT/DELETE) works on
Saved Groups
rest api for me, the one I tested extensively today but I was trying to test other as we might have a use case for programatic project/feature/rules/etc management
f
it works for me on projects
are you sure you're sending the request to the backend service?
ya, seems like it
p
yes, it is our backend thank you for trying it is weird that only POST to
/projects
gives me the error, POSTs to other paths work, so it is not our installation I'll try again the morning
f
ok