2017-06-13 55 views

Trả lời

4

Đối với xã hội:

  1. Thông điệp 404 là một phong tục một (https://github.com/cortiz/social/blob/2.5.x/server/src/main/webapp/404.jsp), bạn có thể kiểm tra mã HTML của phản ứng để xem nếu là container mặc định (hoặc apache) hoặc được cung cấp bởi các ứng dụng.

  2. thực hiện cuộc gọi để có được một sợi (có thể không tồn tại) sử dụng curl hoặc trình duyệt: /crafter-social/api/3/threads/test/comments?context=f5b143c2-f1c0-4a10-b56e-f485f00d3fe9 bạn sẽ nhận được một câu trả lời như:

HTTP/1.1 200 Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, GET, PUT, DELETE
Access-Control-Max-Age: 3600
Access-Control-Allow-Headers: x-requested-with
Access-Control-Allow-Credentials: false
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Tue, 13 Jun 2017 16:45:31 GMT
{"total":0,"pageSize":666,"pageNumber":0,"watched":false,"comments": []}

  1. Curl Sở Tài liệu Swagger: /crafter-social/api-docs

' HTTP/1.1 200 Access-Control-Allow-Origin: * Access-Control-Allow-Methods: POST, GET, PUT, DELETE Access-Control-Max-Age: 3600 Access-Control-Allow-Headers: x-yêu cầu-với Access-Control-Allow-Credentials: false Content-type: application/json; charset = UTF-8 Transfer-Encoding: chunked ngày: Thứ Ba, 13 tháng 6 năm 2017 17:12:45 GMT

{"apiVersion":"1.0","swaggerVersion":"1.2","apis":[{"path":"/default/comment-services","description":"Comments services"},{"path":"/default/comment-services-extension","description":"Comments services Extension"},{"path":"/default/handles-context-configuration","description":"Creates and associates Social Context to profiles"},{"path":"/default/security-actions","description":"Services to Admin Security Actions"},{"path":"/default/system-profile","description":"Clears profile cache,Only for Social Admins or Super Admins."},{"path":"/default/threads-controller","description":"Threads Controller"}],"info":{"title":"API Title","description":"API Description","termsOfServiceUrl":"API terms of service","contact":"API Contact Email","license":"API Licence Type","licenseUrl":"API License URL"}}% 

`

Đối với hồ sơ:

  1. thực hiện cuộc gọi để có được một thuộc tính từ người dùng anon tồn tại với một thẻ truy cập không tồn tại sử dụng curl hoặc trình duyệt: /crafter-profile/api/1/profile/12333/attributes?accessTokenId=12345 bạn sẽ nhận được một câu trả lời như:

'

HTTP/1.1 403 
Content-Type: application/json;charset=UTF-8 
Transfer-Encoding: chunked 
Date: Tue, 13 Jun 2017 17:03:39 GMT 

{"errorCode":"NO_SUCH_ACCESS_TOKEN_ID","message":"No access token found for ID \"12345\""}% 

'

Lưu ý: Không có tùy chọn nào là tối ưu, vui lòng tạo yêu cầu tính năng tại đây: https://github.com/craftercms/craftercms/issues để tạo một dịch vụ theo dõi nhịp tim REST thích hợp cho Tiểu sử và Xã hội.

** Lưu ý 2 ** Tất cả những điều trên chỉ hợp lệ cho 2.5.x.

+0

Có vẻ như /../api-docs/ cho cả tiểu sử và xã hội là tùy chọn tốt nhất vào lúc này. Cảm ơn rất nhiều. Có một api thực được thiết kế để theo dõi sẽ là lý tưởng. Tôi sẽ đưa ra đề nghị của bạn về việc đăng một vấn đề về nó. –

Các vấn đề liên quan