5 Replies Latest reply on Jan 13, 2015 8:16 PM by david.bastedo

    Jive Member service question

    matthew.essel


          In the following jive article : Jive REST Rest API v3.9 → Member service   -- it references using curl to process a group add via curl- - however-- that doesnt appear to work-- has anyone got that aspect working?

        • Re: Jive Member service question
          matthew.essel

          not sure if it is a typo on above referenced link-- but definitely doesnt work with a curl call.. thanks in advance folks. .

            • Re: Jive Member service question

              Hi Matthew,

               

              I just ran the example cURL command from the docs, which I've also included below, and after replacing the username, password, and the API urls then I was able to successfully add another user to the social group.

               

              curl -u admin:password -H "Content-Type: application/json" --data '{ "person": "http://example.jiveon.com/api/core/v3/people/1234", "state": "member" }' http://example.jiveon.com/api/core/v3/members/places/1234

               

              Can you tell me what the error is that is being returned when you run the curl command?  Do you have the correct place ID and user ID? Does the user you're running the curl command for have administrator privileges?

                • Re: Jive Member service question
                  matthew.essel

                  Hi David-- actually i also had the case opened with my company (bnym)-- as such Nathan Howard replied 30 min earlier-- thanks for responding

                  error on curl command is the following:  (excuse word wrapping on paste here)

                   

                   

                   

                  And then we run the command to add—and im back to same fails I
                  had earlier.. you can see below (excuse the wrapping of text.. ) but you will
                  see the errors below..  what version of curl are you using? Maybe a
                  difference perhaps—not sure..

                   

                   

                   

                   

                   

                  C:\Program Files\cURL\bin>curl -u MYID:MYPW -H
                  "Content-Type: application/json" --data '{"person" :
                  "http

                   

                   

                  s://mysourcesocial.bnymellon.net/api/core/v3/people/2064",
                  "state" : "member"}' -X POST -i
                  "https://mysourcesocial.bnyme

                   

                   

                  1. llon.net/api/core/v3/members/places/124945"

                   

                   

                  curl: (7) Failed to connect to  port 80: Connection refused

                   

                   

                  HTTP/1.1 405 Method Not Allowed

                   

                   

                  Date: Tue, 13 Jan 2015 04:35:24 GMT

                   

                   

                  Server: Apache-Coyote/1.1

                   

                   

                  X-Jive-Request-Id: 9733c5c0-9add-11e4-887d-0050569c0488

                   

                   

                  X-Jive-Flow-Id: 9733c5c1-9add-11e4-887d-0050569c0488

                   

                   

                  X-Frame-Options: SAMEORIGIN

                   

                   

                  P3P: CP="CAO PSA OUR"

                   

                   

                  Allow: POST,GET,DELETE,PUT,OPTIONS,HEAD

                   

                   

                  Content-Length: 0

                   

                   

                  Expires: Tue, 13 Jan 2015 04:35:24 GMT

                   

                   

                  Vary: Accept-Encoding,User-Agent

                   

                   

                  Cache-Control: no-store, no-cache, must-revalidate, private,
                  max-age=0

                   

                   

                  X-JSL: D=29915 t=1421123724314613

                   

                   

                  Content-Type: text/plain

                   

                   

                  Set-Cookie: jive.user.loggedIn=true; Path=/;HttpOnly

                   

                   

                  Set-Cookie: jive.login.ts=1421123724332; Path=/;HttpOnly

                   

                   

                  Set-Cookie: jive.server.info="serverName=mysourcesocial.bnymellon.net:serverPort=443:contextPath=:localName=localhost.lo

                   

                   

                  caldomain:localPort=9001:localAddr=127.0.0.1"; Version=1;
                  Path=/;HttpOnly

                   

                   

                  Set-Cookie: jive.user.loggedIn=true; Path=/;HttpOnly

                   

                   

                  Set-Cookie: jive.login.ts=1421123724332; Path=/;HttpOnly

                   

                   

                  Set-Cookie:
                  jive.server.info="serverName=mysourcesocial.bnymellon.net:serverPort=443:contextPath=:localName=localhost.lo

                   

                   

                  caldomain:localPort=9001:localAddr=127.0.0.1"; Version=1;
                  Path=/;HttpOnly

                   

                   

                  Set-Cookie: ROUTEID=.6; path=/; env=BALANCER_ROUTE_CHANGED

                   

                   

                  Set-Cookie:
                  BIGipServermysourcesocial.bnymellon.net-tpc-pool=3692056330.22460.0000; path=/

                   

                   

                  Set-Cookie:
                  cross-prevent=/Common/mysourcesocial.bnymellon.net-tpc-pool;path=/;

                   

                   

                   

                   

                   

                  curl: (6) Could not resolve host: state

                   

                   

                  curl: (7) Failed to connect to  port 80: Connection refused

                   

                   

                  curl: (3) [globbing] unmatched close brace/bracket in column 7

                   

                   

                  HTTP/1.1 400 Bad Request

                   

                   

                  Date: Tue, 13 Jan 2015 04:35:28 GMT

                   

                   

                  Server: Apache-Coyote/1.1

                   

                   

                  X-Jive-Request-Id: 9977e960-9add-11e4-bd83-0050569c04a5

                   

                   

                  X-Jive-Flow-Id: 9977e961-9add-11e4-bd83-0050569c04a5

                   

                   

                  X-Frame-Options: SAMEORIGIN

                   

                   

                  P3P: CP="CAO PSA OUR"

                   

                   

                  Content-Type: application/json

                   

                   

                  Content-Length: 101

                   

                   

                  Expires: Tue, 13 Jan 2015 04:35:28 GMT

                   

                   

                  Vary: Accept-Encoding,User-Agent

                   

                   

                  Cache-Control: no-store, no-cache, must-revalidate, private,
                  max-age=0

                   

                   

                  X-JSL: D=61044 t=1421123728113449

                   

                   

                  Set-Cookie: jive.user.loggedIn=true; Path=/;HttpOnly

                   

                   

                  Set-Cookie: jive.login.ts=1421123728160; Path=/;HttpOnly

                   

                   

                  Set-Cookie:
                  jive.server.info="serverName=mysourcesocial.bnymellon.net:serverPort=443:contextPath=:localName=localhost.lo

                   

                   

                  caldomain:localPort=9001:localAddr=127.0.0.1"; Version=1;
                  Path=/;HttpOnly

                   

                   

                  Set-Cookie: jive.user.loggedIn=true; Path=/;HttpOnly

                   

                   

                  Set-Cookie: jive.login.ts=1421123728160; Path=/;HttpOnly

                   

                   

                  Set-Cookie: jive.server.info="serverName=mysourcesocial.bnymellon.net:serverPort=443:contextPath=:localName=localhost.lo

                   

                   

                  caldomain:localPort=9001:localAddr=127.0.0.1"; Version=1;
                  Path=/;HttpOnly

                   

                   

                  Set-Cookie: ROUTEID=.9; path=/; env=BALANCER_ROUTE_CHANGED

                   

                   

                  Connection: close

                   

                   

                  Set-Cookie:
                  cross-prevent=/Common/mysourcesocial.bnymellon.net-tpc-pool;path=/;

                   

                   

                   

                   

                   

                  {"error":{"message":"A JSONObject text must
                  begin with '{' at character 1 of '{person","status":400}}

                   

                   

                   

              • Re: Jive Member service question

                Just to follow up here in case anyone else in the community runs into the same set of errors:

                 

                The cause of the problem is due to the use of cURL in Windows's cmd.exe terminal app, which does not allow single quote characters, which is what will prevent you from using the example cURL command found in the API documentation. In order for someone to work around that issue they will need to adjust the cURL command so that you use double quotes and you have to escape the quotes inside of the data payload (e.g. use \" instead of ')

                 

                Command from the API docs (fails in Windows):

                curl -u admin:password -H "Content-Type: application/json" --data '{ "person": "http://example.jiveon.com/api/core/v3/people/1234", "state": "member" }' http://example.jiveon.com/api/core/v3/members/places/1234

                 

                 

                Adjusted command for Windows cmd.exe:

                curl -u admin:password -H "Content-Type: application/json" --data "{ \"person\": \"http://example.jiveon.com/api/core/v3/people/1234\", \"state\": \"member\" }" http://example.jiveon.com/api/core/v3/members/places/1234