Response 200 but didn't do anything

  • 1
  • Problem
  • Updated 1 year ago
I have quite a lot of API calls that respond with a 200 code (and without an error in the body) but when I check if it worked it often didn't do anything.

I have this problem with:
 - Creating a group with users (it does create the group, but doesn't add the users)
 - Adding users to a group
 - Uploading files

And I also have some API calls that result in 500 internal server errors and lots of other problems (even though I follow all the steps and even with the given code samples).

Could this be because I currently only have a trail or is there actually something wrong?

I really need help with this.
Photo of Rick Cuijpers

Rick Cuijpers

  • 13 Posts
  • 1 Reply Like
  • frustrated

Posted 1 year ago

  • 1
Photo of Nikita Nuka

Nikita Nuka, Employee

  • 11 Posts
  • 2 Reply Likes
Hello, Rick.
Would you, please, provide some samples of API calls (URLs, headers, body) that failed/didn't do what they were supposed to?

Thank you!

Best Regards,
Nikita Nuka,
Photo of Rick Cuijpers

Rick Cuijpers

  • 13 Posts
  • 1 Reply Like
For example: To add a user to a group, I post to:
https://triptic.sharefile.com/sf/v3/Groups(gb588a42-8cda-48d8-9e9e-5c6ca59d7c27)/Contacts
With the following parameters:
[
    "headers" => (1)[
        "Authorization" => (73)"Bearer [[valid-token]]"
    ]
    "form_params" => (1)[
        "contacts" => (1)[
            "Id" => (36)"2bdb8c73-6239-45aa-8fd4-ef90d01cb262"
        ]
    ]
]
And I get a 200 response with the following body:
[
    "odata.metadata" => (54)"https://triptic.sharefile.com/sf/v3/$metadata#Contacts"
    "odata.count" => 0
    "value" => []
    "url" => (44)"https://triptic.sharefile.com/sf/v3/Contacts"
]
The response should give back the updated group, and therefore already suggests that it didn't add the user. But just to be sure, I've also checked the web-interface, and it isn't added.
(Edited)
Photo of Rick Cuijpers

Rick Cuijpers

  • 13 Posts
  • 1 Reply Like
I found the problem, I didn't send it as json but as form data.