How can I GET/POST flag user by REST API in Drupal 8 or higher

Created on 22 February 2018, about 7 years ago
Updated 19 February 2025, 3 months ago

am using flag module. I want to provide api for mobile application, that we can POST or GET flag content. Is there any way to return an api by POST / GET method in RESTfull to do it?

i do like that in RESTCLIENT but not solved:

POST: http:www.example.com/entity/flagging/Favorite?_format=json

Parameters:

{"flag_id":"Content" ,"flag_name":"Favorites", "content_id":"34", "action": "flag"}

and i have problem in this module is that what the flag_id meaning i tried every thing to write in that place but always coming false and told me is not a valid bundle type for denormalization so what can i do ????
Thanks

💬 Support request
Status

Needs work

Version

4.0

Component

Flag Bookmark

Created by

🇦🇪United Arab Emirates Moniroaf

Live updates comments and jobs are added and updated live.
  • Needs reroll

    The patch will have to be re-rolled with new suggestions/changes described in the comments in the issue.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Pipeline finished with Success
    3 months ago
    Total: 162s
    #429610
  • 🇪🇸Spain omarlopesino

    Merge request re-rolled. Tests are passing now. Ready to review again.

  • ivnish Kazakhstan

    @omarlopesino, thanks!

    Needs to fix pipeline warnings

  • Pipeline finished with Success
    2 months ago
    Total: 160s
    #439718
  • Pipeline finished with Success
    2 months ago
    Total: 154s
    #439730
  • Pipeline finished with Success
    2 months ago
    Total: 164s
    #439731
  • Pipeline finished with Success
    2 months ago
    Total: 157s
    #439747
  • Pipeline finished with Success
    2 months ago
    Total: 176s
    #439751
  • 🇪🇸Spain omarlopesino

    All the warnings reported by static analysis have been fixed, which led to some small refactors. It should preserve the old behaviour. Please review, thanks!

  • ivnish Kazakhstan

    Thanks! Needs to add some tests for REST

  • First commit to issue fork.
  • 🇧🇪Belgium RandalV

    I had encountered a bug in a react application (embedded in Drupal on the same domain) that for anonymous users, no session id was present.
    I found the functionality where this was set and extended it slightly, this should correctly set the session id if it's ever missing.

    I also fixed the core version requirement I had mentioned before.

    The tests are still needed though, leaving status as-is.

Production build 0.71.5 2024