These are chat archives for fossasia/open-event-server

20th
Jul 2017
Dilpreet Singh
@geekyd
Jul 20 2017 17:35

Hey guys I’m trying to update the user using the endpoint v1/users/10

payload:

{
  "data": {
    "attributes": {
      "first-name": "Dilpreet",
      "last-name": "Singh",
      "details": “",
      "contact": "",
      "facebook-url": "",
      "twitter-url": "",
      "instagram-url": "",
      "google-plus-url": "",
      "thumbnail-image-url": "",
      "small-image-url": "",
      "icon-image-url": ""
    },
    "type": "user",
    "id": "10"
  }
}

It was working fine earlier today now it seems to give error, can anyone please check whats wrong ?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>405 Method Not Allowed</title>
<h1>Method Not Allowed</h1>
<p>The method is not allowed for the requested URL.</p>
Shubham Padia
@shubham-padia
Jul 20 2017 17:39
@geekyd can you check again, I've not tried updating a user, but the PATCH method is allowed atleast on http://open-event-api.herokuapp.com/v1/users/10
Dilpreet Singh
@geekyd
Jul 20 2017 17:42
Screen Shot 2017-07-20 at 11.11.15 PM.png

@shubham-padia It is not working for me

I’m setting the headers correctly

Sumedh Nimkarde
@lunaticmonk
Jul 20 2017 17:43
@geekyd I am also getting problem
Shubham Padia
@shubham-padia
Jul 20 2017 17:44
can you show the full screenshot please with the response :smile: ?
Dilpreet Singh
@geekyd
Jul 20 2017 17:45
Sure
The Request
:point_down:
Screen Shot 2017-07-20 at 11.15.19 PM.png
The Response :point_down:
Screen Shot 2017-07-20 at 11.14.48 PM.png
Shubham Padia
@shubham-padia
Jul 20 2017 17:47
The user is already created, you should be doing a PATCH request instead of POST, see the documentation for more
Dilpreet Singh
@geekyd
Jul 20 2017 17:48
I’m facing the same issue when I’m making the requests from the front end which sends a patch request
Shubham Padia
@shubham-padia
Jul 20 2017 17:50
is it giving 405 method not allowed on frontend ?
Dilpreet Singh
@geekyd
Jul 20 2017 17:51
Hey no its giving 422 the reason behind that is the social urls being set to null or empty string
It was working fine earlier did something change on the server?
Shubham Padia
@shubham-padia
Jul 20 2017 17:56
nothing was changed, null values are still accepted, can you if the urls are valid indeed ?
okay wait...
Dilpreet Singh
@geekyd
Jul 20 2017 17:57
I think it is, i have been testing using the same user since morning
I’m getting this when I do a PATCH request
Screen Shot 2017-07-20 at 11.30.45 PM.png
Shubham Padia
@shubham-padia
Jul 20 2017 18:02
Yeah, getting that, the problem has been noted, will look into that :+1:
Dilpreet Singh
@geekyd
Jul 20 2017 18:02
Thanks :)
Afroz Ahamad
@enigmaeth
Jul 20 2017 18:31
@geekyd instagram-url: null works as of now, if you want to insert null value
"instagram-url": null *
Dilpreet Singh
@geekyd
Jul 20 2017 18:35
@enigmaeth Thanks for pointing that out
Afroz Ahamad
@enigmaeth
Jul 20 2017 18:35
:+1:
Harshita Gupta
@harshitagupta30
Jul 20 2017 21:16

Hi! I have been trying to add sponsors to an event using the end point : /v1/sponsors with payload :

{
  "data": {
    "attributes": {
      "name": "Fossasia",
      "description": "Fossasia",
      "logo-url": "http://2017.fossasia.org/img/fossasia-square-300dpi.png",
      "url": "http://fossasia.org",
      "level": "1",
      "type": "Gold"
    },
    "type": "sponsor",
    "relationships": {
      "event": {
        "links": {
          "self": "/v1/sponsors/105/relationships/event",
          "related": "/v1/sponsors/105/event"
       }
     }
    }
  }
}

But I am getting the response:

{
    "errors": [
        {
            "source": {
                "source": ""
            },
            "status": 403,
            "title": "Access Forbidden",
            "detail": "Access forbidden"
        }
    ],
    "jsonapi": {
        "version": "1.0"
    }
}

Can somebody please help?

Areeb Jamal
@iamareebjamal
Jul 20 2017 23:06
Guys, can't PATCH event without timezone attribute. Is this intended?