代码之家  ›  专栏  ›  技术社区  ›  GarySabo

Pinterest IOS SDK getBoardPins响应代码=-1011“请求失败:错误请求(400)”

  •  0
  • GarySabo  · 技术社区  · 8 年前

    我收到了一个糟糕的退货请求

     PDKClient.sharedInstance().getBoardPins(boardID, fields: ["image", "description"], withSuccess: { (responseObject :PDKResponseObject!) -> Void in
    
                print(responseObject.pins().first!.descriptionText)
    
                })  { (err :NSError!) -> Void in
                    print("error NSError: \(err)")
            }
    

    正在从传递boardID:

    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
            if let dvc = segue.destinationViewController as? PinCollectionViewController {
               dvc.boardID = selectedBoard.identifier
        }
    

    我想不通为什么?我知道我的电路板ID是正确的,并努力编码。我已经被认证了。。。

    从SDK:

    /**
     *  Get a list of pins for the given board. The response can be used to get
     *  the bext page of pins.
     *
     *  @param boardId      ID of the board
     *  @param fields       The pin fields that will be returned by the api
     *  @param successBlock Called when the API call succeeds
     *  @param failureBlock Called when the API call fails
     */
    - (void)getBoardPins:(NSString *)boardId
                  fields:(NSSet *)fields
             withSuccess:(PDKClientSuccess)successBlock
              andFailure:(PDKClientFailure)failureBlock;
    
    1 回复  |  直到 8 年前
        1
  •  0
  •   GarySabo    8 年前

    我将字段更改为:

    PDKClient.sharedInstance().getBoardPins(boardID, fields: ["id", "image", "note"], withSuccess: { (responseObject :PDKResponseObject!) -> Void in
    
            print(responseObject.pins().first!.descriptionText)
    
            })  { (err :NSError!) -> Void in
                print("error NSError: \(err)")
        }
    

    并且能够成功收到响应